[IMP] base: do not update country on state change
In the partner form, when you change the state of the partner address and the country remains the same, it still triggers an update on the country field. This change makes sure that the country is only updated when it has actually changed. task-3143841 closes odoo/odoo#111230 Related: odoo/enterprise#36386 Related: odoo/upgrade#4277 Signed-off-by: Quentin De Paoli <qdp@odoo.com>
This commit is contained in:
@@ -474,7 +474,7 @@ class Partner(models.Model):
|
||||
|
||||
@api.onchange('state_id')
|
||||
def _onchange_state(self):
|
||||
if self.state_id.country_id:
|
||||
if self.state_id.country_id and self.country_id != self.state_id.country_id:
|
||||
self.country_id = self.state_id.country_id
|
||||
|
||||
@api.onchange('email')
|
||||
|
||||
Reference in New Issue
Block a user