diff --git a/base_location_nuts/models/res_partner.py b/base_location_nuts/models/res_partner.py index 94e41d009..a1117d689 100644 --- a/base_location_nuts/models/res_partner.py +++ b/base_location_nuts/models/res_partner.py @@ -35,16 +35,16 @@ class ResPartner(models.Model): @api.multi @api.onchange("substate_id") def _onchange_substate_id(self): - for s in self: - if s.substate_id.country_id: - s.country_id = s.substate_id.country_id + if self.substate_id.country_id: + self.country_id = self.substate_id.country_id + return dict() @api.multi @api.onchange("region_id") def _onchange_region_id(self): - for s in self: - if s.region_id.country_id: - s.country_id = s.region_id.country_id + if self.region_id.country_id: + self.country_id = self.region_id.country_id + return dict() @api.multi @api.onchange("country_id")