From 1d99784a0a095fa522b99f3ce9cd145c35f68f52 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 6 Jan 2015 10:47:10 +0100 Subject: [PATCH] [FIX] report: allow margin with size 0 Setting the margins of a paperformat to 0mm was ignored and fallbacked on wkhtml default margins. This change is considered as relatively safe as margin-* fields have a default value and setting 0 is then an explicit choice. Fixes #3367, opw 620130 --- addons/report/models/report.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 057d3565abd..21ea84ab01d 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -519,7 +519,7 @@ class Report(osv.Model): if specific_paperformat_args and specific_paperformat_args.get('data-report-margin-top'): command_args.extend(['--margin-top', str(specific_paperformat_args['data-report-margin-top'])]) - elif paperformat.margin_top: + else: command_args.extend(['--margin-top', str(paperformat.margin_top)]) if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'): @@ -536,12 +536,9 @@ class Report(osv.Model): elif paperformat.header_spacing: command_args.extend(['--header-spacing', str(paperformat.header_spacing)]) - if paperformat.margin_left: - command_args.extend(['--margin-left', str(paperformat.margin_left)]) - if paperformat.margin_bottom: - command_args.extend(['--margin-bottom', str(paperformat.margin_bottom)]) - if paperformat.margin_right: - command_args.extend(['--margin-right', str(paperformat.margin_right)]) + command_args.extend(['--margin-left', str(paperformat.margin_left)]) + command_args.extend(['--margin-bottom', str(paperformat.margin_bottom)]) + command_args.extend(['--margin-right', str(paperformat.margin_right)]) if paperformat.orientation: command_args.extend(['--orientation', str(paperformat.orientation)]) if paperformat.header_line: