|
@ -33,7 +33,6 @@ class ResCompany(models.Model): |
|
|
inverse="_inverse_zip_id", |
|
|
inverse="_inverse_zip_id", |
|
|
help="Use the city name or the zip code to search the location", |
|
|
help="Use the city name or the zip code to search the location", |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
country_enforce_cities = fields.Boolean( |
|
|
country_enforce_cities = fields.Boolean( |
|
|
related="partner_id.country_id.enforce_cities" |
|
|
related="partner_id.country_id.enforce_cities" |
|
|
) |
|
|
) |
|
@ -48,24 +47,20 @@ class ResCompany(models.Model): |
|
|
return res |
|
|
return res |
|
|
|
|
|
|
|
|
def _inverse_city_id(self): |
|
|
def _inverse_city_id(self): |
|
|
for company in self: |
|
|
|
|
|
company.with_context( |
|
|
|
|
|
skip_check_zip=True |
|
|
|
|
|
).partner_id.city_id = company.city_id |
|
|
|
|
|
|
|
|
for company in self.with_context(skip_check_zip=True): |
|
|
|
|
|
company.partner_id.city_id = company.city_id |
|
|
|
|
|
|
|
|
def _inverse_zip_id(self): |
|
|
def _inverse_zip_id(self): |
|
|
for company in self: |
|
|
|
|
|
company.with_context(skip_check_zip=True).partner_id.zip_id = company.zip_id |
|
|
|
|
|
|
|
|
for company in self.with_context(skip_check_zip=True): |
|
|
|
|
|
company.partner_id.zip_id = company.zip_id |
|
|
|
|
|
|
|
|
def _inverse_state(self): |
|
|
def _inverse_state(self): |
|
|
return super( |
|
|
|
|
|
ResCompany, self.with_context(skip_check_zip=True) |
|
|
|
|
|
)._inverse_state() |
|
|
|
|
|
|
|
|
self = self.with_context(skip_check_zip=True) |
|
|
|
|
|
return super(ResCompany, self)._inverse_state() |
|
|
|
|
|
|
|
|
def _inverse_country(self): |
|
|
def _inverse_country(self): |
|
|
return super( |
|
|
|
|
|
ResCompany, self.with_context(skip_check_zip=True) |
|
|
|
|
|
)._inverse_country() |
|
|
|
|
|
|
|
|
self = self.with_context(skip_check_zip=True) |
|
|
|
|
|
return super(ResCompany, self)._inverse_country() |
|
|
|
|
|
|
|
|
@api.onchange("zip_id") |
|
|
@api.onchange("zip_id") |
|
|
def _onchange_zip_id(self): |
|
|
def _onchange_zip_id(self): |
|
|