diff --git a/addons/web/views/report_templates.xml b/addons/web/views/report_templates.xml index 6c8b8b1ab06..e22bc9edaf2 100644 --- a/addons/web/views/report_templates.xml +++ b/addons/web/views/report_templates.xml @@ -50,6 +50,7 @@ t-att-data-report-margin-top="data_report_margin_top" t-att-data-report-header-spacing="data_report_header_spacing" t-att-data-report-dpi="data_report_dpi" + t-att-data-report-landscape="data_report_landscape" t-att-web-base-url="web_base_url"> diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py index f5537b631d2..f1d7c812fde 100644 --- a/odoo/addons/base/models/ir_actions_report.py +++ b/odoo/addons/base/models/ir_actions_report.py @@ -206,6 +206,9 @@ class IrActionsReport(models.Model): :param set_viewport_size: Enable a viewport sized '1024x1280' or '1280x1024' depending of landscape arg. :return: A list of string representing the wkhtmltopdf process command args. ''' + if landscape is None and specific_paperformat_args and specific_paperformat_args.get('data-report-landscape'): + landscape = specific_paperformat_args.get('data-report-landscape') + command_args = [] if set_viewport_size: command_args.extend(['--viewport-size', landscape and '1024x1280' or '1280x1024'])