From 8f3319e69506bf443ae5d499935e802be419778c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 30 Dec 2015 18:27:32 +0100 Subject: [PATCH] Return dict() to make it easier for submodules to add domains. --- base_location_nuts/models/res_partner.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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")