From 95db4e9e30908c466444d3d0f564ccb38cbdc75d Mon Sep 17 00:00:00 2001 From: Samuele Carli Date: Fri, 4 May 2018 11:07:59 +0200 Subject: [PATCH] [ZELO][FIX] base_location: fix onchange company zip_id to reset partner zip_id as well (avoid constraint error on parter while saving) --- base_location/models/company.py | 1 + 1 file changed, 1 insertion(+) diff --git a/base_location/models/company.py b/base_location/models/company.py index 3c0e78560..c0bfd1de2 100644 --- a/base_location/models/company.py +++ b/base_location/models/company.py @@ -54,6 +54,7 @@ class ResCompany(models.Model): @api.onchange('zip_id') def _onchange_zip_id(self): if self.zip_id: + self.partner_id.write({'zip_id': False}) self.zip = self.zip_id.name self.city_id = self.zip_id.city_id self.city = self.zip_id.city