diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index ea578d5a..06f57526 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Account Financial Reports", - "version": "13.0.1.3.1", + "version": "13.0.1.3.2", "category": "Reporting", "summary": "OCA Financial Reports", "author": "Camptocamp SA," diff --git a/account_financial_report/models/ir_actions_report.py b/account_financial_report/models/ir_actions_report.py index 83c1435b..1c718526 100644 --- a/account_financial_report/models/ir_actions_report.py +++ b/account_financial_report/models/ir_actions_report.py @@ -9,19 +9,17 @@ class IrActionsReport(models.Model): @api.model def _prepare_account_financial_report_context(self, data): - lang = data.get("account_financial_report_lang") - return dict(self.env.context or {}, lang=lang) if lang else self.env.context + lang = data and data.get("account_financial_report_lang") or "" + return dict(self.env.context or {}, lang=lang) if lang else False @api.model def render_qweb_html(self, docids, data=None): - return super( - IrActionsReport, - self.with_context(self._prepare_account_financial_report_context(data)), - ).render_qweb_html(docids, data) + context = self._prepare_account_financial_report_context(data) + obj = self.with_context(context) if context else self + return super(IrActionsReport, obj).render_qweb_html(docids, data) @api.model def render_xlsx(self, docids, data): - return super( - IrActionsReport, - self.with_context(self._prepare_account_financial_report_context(data)), - ).render_xlsx(docids, data) + context = self._prepare_account_financial_report_context(data) + obj = self.with_context(context) if context else self + return super(IrActionsReport, obj).render_xlsx(docids, data)