Skip to content

Commit

Permalink
[IMP] l10n_it_rea: optimize a bit the code of onchange_rea_data metho…
Browse files Browse the repository at this point in the history
…d and fix the following warnings that are getting runbot build red. (#1)

2020-11-20 10:30:20,958 160 WARNING openerp_test odoo.fields: res.company.rea_member_type: selection attribute will be ignored as the field is related
2020-11-20 10:30:20,959 160 WARNING openerp_test odoo.fields: res.company.rea_liquidation_state: selection attribute will be ignored as the field is related
  • Loading branch information
tafaRU authored Nov 20, 2020
1 parent fe65145 commit ac84431
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 1 addition & 8 deletions l10n_it_rea/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,11 @@ class Company(models.Model):
"Share Capital", related="partner_id.rea_capital", store=True, readonly=False
)
rea_member_type = fields.Selection(
[("SU", "Unique Member"), ("SM", "Multiple Members")],
"Member Type",
related="partner_id.rea_member_type",
store=True,
readonly=False,
)
rea_liquidation_state = fields.Selection(
[("LS", "In liquidation"), ("LN", "Not in liquidation")],
"Liquidation State",
related="partner_id.rea_liquidation_state",
store=True,
readonly=False,
)

Expand All @@ -43,15 +37,14 @@ class Company(models.Model):
"rea_liquidation_state",
)
def onchange_rea_data(self):
self.company_registry = ""
rea_member_type = ""
if (
self.rea_office
or self.rea_code
or self.rea_capital
or self.rea_member_type
or self.rea_liquidation_state
):
rea_member_type = ""
if self.rea_member_type:
rea_member_type = dict(
self.env["res.partner"]
Expand Down
1 change: 1 addition & 0 deletions l10n_it_rea/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* Andrea Gallina
* Sergio Zanchetta <https://github.com/primes2h>
* Gianmarco Conte - Dinamiche Aziendali Srl <[email protected]>
* Alex Comba <[email protected]>

0 comments on commit ac84431

Please sign in to comment.