[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
This commit is contained in:
parent
39748abf8c
commit
1d99784a0a
|
@ -519,7 +519,7 @@ class Report(osv.Model):
|
||||||
|
|
||||||
if specific_paperformat_args and specific_paperformat_args.get('data-report-margin-top'):
|
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'])])
|
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)])
|
command_args.extend(['--margin-top', str(paperformat.margin_top)])
|
||||||
|
|
||||||
if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'):
|
if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'):
|
||||||
|
@ -536,12 +536,9 @@ class Report(osv.Model):
|
||||||
elif paperformat.header_spacing:
|
elif paperformat.header_spacing:
|
||||||
command_args.extend(['--header-spacing', str(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)])
|
||||||
command_args.extend(['--margin-left', str(paperformat.margin_left)])
|
command_args.extend(['--margin-bottom', str(paperformat.margin_bottom)])
|
||||||
if paperformat.margin_bottom:
|
command_args.extend(['--margin-right', str(paperformat.margin_right)])
|
||||||
command_args.extend(['--margin-bottom', str(paperformat.margin_bottom)])
|
|
||||||
if paperformat.margin_right:
|
|
||||||
command_args.extend(['--margin-right', str(paperformat.margin_right)])
|
|
||||||
if paperformat.orientation:
|
if paperformat.orientation:
|
||||||
command_args.extend(['--orientation', str(paperformat.orientation)])
|
command_args.extend(['--orientation', str(paperformat.orientation)])
|
||||||
if paperformat.header_line:
|
if paperformat.header_line:
|
||||||
|
|
Loading…
Reference in New Issue