Skip to content

Commit 6abb7ec

Browse files
committed
[FIX] landscape in print
1 parent 737c66e commit 6abb7ec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

report_playwright/models/ir_actions_report.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def _build_playwright_options(
114114
if not landscape and paperformat_id.orientation:
115115
options["landscape"] = str(paperformat_id.orientation) == "Landscape"
116116

117-
options["landscape"] = landscape
117+
if "landscape" not in options:
118+
options["landscape"] = landscape
118119

119120
if header_content:
120121
options["headerTemplate"] = header_content
@@ -165,6 +166,8 @@ def _run_playwright(
165166
page = b_context.new_page()
166167
page.goto(url)
167168
page.pdf(
169+
header_template=print_options["headerTemplate"],
170+
footer_template=print_options["headerTemplate"],
168171
format=print_options["format"],
169172
margin=print_options["margin"],
170173
landscape=print_options["landscape"],
@@ -245,7 +248,6 @@ def _render_playwright_pdf_prepare_streams(self, report_ref, data, res_ids=None)
245248
is_playwright_needed = not res_ids or res_ids_wo_stream
246249

247250
if is_playwright_needed:
248-
249251
if self.get_playwright_state() == "install":
250252
# playwright is not installed
251253
# the call should be catched before (cf /report/check_wkhtmltopdf) but

0 commit comments

Comments
 (0)