[FIX] translation not loaded

This commit is contained in:
Andrea
2020-08-05 12:13:03 +02:00
committed by chaule97
parent 3a55e90a92
commit 8cb94660e0
26 changed files with 120 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
from . import account
from . import account_group
from . import account_move_line
from . import ir_actions_report

View File

@@ -0,0 +1,27 @@
# Copyright 2020 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
class IrActionsReport(models.Model):
_inherit = "ir.actions.report"
@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
@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)
@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)