diff --git a/base_location/better_zip.py b/base_location/better_zip.py index 56de4616e..8d6d01614 100644 --- a/base_location/better_zip.py +++ b/base_location/better_zip.py @@ -51,7 +51,7 @@ class BetterZip(orm.Model): res.append((bzip.id, ", ".join(name))) return res - def onchange_state_id(self, cr, uid, ids, state_id=False, context={}): + def onchange_state_id(self, cr, uid, ids, state_id=False, context=None): result = {} if state_id: state = self.pool['res.country.state'].browse(cr, uid, state_id, context=context) diff --git a/base_location/company.py b/base_location/company.py index 03ab50bb5..6f52c7bd0 100644 --- a/base_location/company.py +++ b/base_location/company.py @@ -26,10 +26,12 @@ class ResCompany(orm.Model): _inherit = 'res.company' - def on_change_city(self, cursor, uid, ids, zip_id): + def on_change_city(self, cr, uid, ids, zip_id, context=None): result = {} + if context is None: + context = {} if zip_id: - bzip = self.pool['res.better.zip'].browse(cursor, uid, zip_id) + bzip = self.pool['res.better.zip'].browse(cr, uid, zip_id, context=context) result = {'value': {'zip': bzip.name, 'country_id': bzip.country_id.id if bzip.country_id else False, 'city': bzip.city,