diff --git a/report_aeroo/ExtraFunctions.py b/report_aeroo/ExtraFunctions.py index c1be814a..2bd32e2f 100755 --- a/report_aeroo/ExtraFunctions.py +++ b/report_aeroo/ExtraFunctions.py @@ -284,9 +284,14 @@ def _asarray(self, attr, field): exec expr in localspace return localspace['value_list'] - def _get_name(self, obj): + def _get_name(self, obj, context=None): if isinstance(obj, models.Model): - return obj.name_get()[0][1] + if context and isinstance(context, dict): + new_context = obj._context.copy() + new_context.update(context) + return obj.with_context(new_context).name_get()[0][1] + else: + return obj.name_get()[0][1] return '' def _get_label(self, obj, field):