[IMP] Base: Forwarding missing model context

This change allows us to get the model context in order to know if we
have a lead or an opportunity which is important to display the right
word.
This commit is contained in:
RomainLibert
2018-01-15 10:23:13 +01:00
parent 03a36a9bba
commit 8aa27eeefd
+6 -1
View File
@@ -196,7 +196,12 @@ class IrActionsActWindow(models.Model):
for values in result:
model = values.get('res_model')
if model in self.env:
values['help'] = self.env[model].get_empty_list_help(values.get('help', ""))
eval_ctx = dict(self.env.context)
try:
ctx = safe_eval(values.get('context', '{}'), eval_ctx)
except:
ctx = {}
values['help'] = self.with_context(**ctx).env[model].get_empty_list_help(values.get('help', ''))
return result
@api.model