Browse Source

[ZELO][FIX] base_location: fix onchange company zip_id to reset partner zip_id as well (avoid constraint error on parter while saving)

pull/582/head
Samuele Carli 7 years ago
parent
commit
95db4e9e30
  1. 1
      base_location/models/company.py

1
base_location/models/company.py

@ -54,6 +54,7 @@ class ResCompany(models.Model):
@api.onchange('zip_id') @api.onchange('zip_id')
def _onchange_zip_id(self): def _onchange_zip_id(self):
if self.zip_id: if self.zip_id:
self.partner_id.write({'zip_id': False})
self.zip = self.zip_id.name self.zip = self.zip_id.name
self.city_id = self.zip_id.city_id self.city_id = self.zip_id.city_id
self.city = self.zip_id.city self.city = self.zip_id.city

Loading…
Cancel
Save