|
@ -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) |