fix contract generation
All checks were successful
Deploy Amap / deploy (push) Successful in 9s

This commit is contained in:
Julien Aldon
2026-02-20 11:17:20 +01:00
parent 7a94f1c96a
commit af4941c1b9

View File

@@ -42,25 +42,24 @@ def generate_html_contract(
contract_payment_method={"cheque": "chèque", "transfer": "virements"}[contract.payment_method], contract_payment_method={"cheque": "chèque", "transfer": "virements"}[contract.payment_method],
cheques=cheques cheques=cheques
) )
options = { # options = {
'page-size': 'Letter', # 'page-size': 'Letter',
'margin-top': '0.5in', # 'margin-top': '0.5in',
'margin-right': '0.5in', # 'margin-right': '0.5in',
'margin-bottom': '0.5in', # 'margin-bottom': '0.5in',
'margin-left': '0.5in', # 'margin-left': '0.5in',
'encoding': "UTF-8", # 'encoding': "UTF-8",
'print-media-type': True, # 'print-media-type': True,
"disable-javascript": True, # "disable-javascript": True,
"disable-external-links": True, # "disable-external-links": True,
'enable-local-file-access': False, # 'enable-local-file-access': False,
"disable-local-file-access": True, # "disable-local-file-access": True,
"no-images": True, # "no-images": True,
} # }
return HTML( return HTML(
string=output_text, string=output_text,
base_url=template_dir, base_url=template_dir,
**options
).write_pdf() ).write_pdf()
from odfdo import Document, Table, Row, Cell from odfdo import Document, Table, Row, Cell