Legal name in report header
This commit is contained in:
@@ -21,7 +21,8 @@ This module adds 2 fields on the Company :
|
|||||||
""",
|
""",
|
||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
'depends': ['base'],
|
# I depend on base_usability only for _report_company_legal_name()
|
||||||
|
'depends': ['base_usability'],
|
||||||
'data': ['company_view.xml'],
|
'data': ['company_view.xml'],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ class ResCompany(models.Model):
|
|||||||
legal_type = fields.Char(
|
legal_type = fields.Char(
|
||||||
string="Legal Type", help="Type of Company, e.g. SARL, SAS, ...")
|
string="Legal Type", help="Type of Company, e.g. SARL, SAS, ...")
|
||||||
|
|
||||||
|
def _report_company_legal_name(self):
|
||||||
|
self.ensure_one()
|
||||||
|
if self.legal_type:
|
||||||
|
name = u'%s %s' % (self.name, self.legal_type)
|
||||||
|
else:
|
||||||
|
name = self.name
|
||||||
|
return name
|
||||||
|
|
||||||
_sql_constraints = [(
|
_sql_constraints = [(
|
||||||
'capital_amount_positive',
|
'capital_amount_positive',
|
||||||
'CHECK (capital_amount >= 0)',
|
'CHECK (capital_amount >= 0)',
|
||||||
|
|||||||
Reference in New Issue
Block a user