diff --git a/openerp/models.py b/openerp/models.py index ace7abed3a1..e57264ccae4 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -5715,9 +5715,13 @@ class BaseModel(object): } params = eval("[%s]" % params, global_vars, field_vars) - # call onchange method + # call onchange method with context when possible args = (self._cr, self._uid, self._origin.ids) + tuple(params) - method_res = getattr(self._model, method)(*args) + try: + method_res = getattr(self._model, method)(*args, context=self._context) + except TypeError: + method_res = getattr(self._model, method)(*args) + if not isinstance(method_res, dict): return if 'value' in method_res: