Skip to content

Commit

Permalink
[ADD] street_name to res.company
Browse files Browse the repository at this point in the history
  • Loading branch information
mileo committed Oct 24, 2022
1 parent a1e63da commit 0c705dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions l10n_br_base/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def _get_company_address_field_names(self):
"suframa",
"state_tax_number_ids",
"street_number",
"street_name",
]

def _inverse_legal_name(self):
Expand All @@ -38,6 +39,11 @@ def _inverse_district(self):
for company in self:
company.partner_id.district = company.district

def _inverse_street_name(self):
"""Write the l10n_br specific functional fields."""
for company in self:
company.partner_id.street_name = company.street_name

def _inverse_street_number(self):
"""Write the l10n_br specific functional fields."""
for company in self:
Expand Down Expand Up @@ -88,6 +94,11 @@ def _inverse_suframa(self):
inverse="_inverse_district",
)

street_name = fields.Char(
compute="_compute_address",
inverse="_inverse_street_name",
)

street_number = fields.Char(
compute="_compute_address",
inverse="_inverse_street_number",
Expand Down

0 comments on commit 0c705dc

Please sign in to comment.