summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2021-04-22 11:45:09 +0000
committerNicolas Lempereur <nle@odoo.com>2021-04-22 14:51:49 +0000
commitae3209b56087bdf0b11927ab59f8b33541713876 (patch)
treec16d3f7f172520f779a83a6d9bc2a09743d0762a
parenta52aa41d04330efb81090409ec7fbcbbedaca317 (diff)
[FIX] l10n_latam_invoice_document: header/footer in mutli-print
When l10n_latam_invoice_document is installed and the current company does not have a custom header (in stable, only Chile and Argentina with their localization installed use custom header), printing multiple invoice at once, one out of two had no header or footer. This is because `<div class="header"/>` and `<div class="footer"/>` should be unique per record being printed, and when a custom header was not used they were duplicated with the duplicate empty. As an example, if we had 3 documents: - record 1 : good header - record 1 : empty header - record 1 : body - record 1 : good footer - record 1 : empty footer - record 2 : good header - record 2 : empty header - record 2 : body - record 2 : good footer - record 2 : empty footer - record 3 : good header - record 3 : empty header - record 3 : body - record 3 : good footer - record 3 : empty footer When we give them to wkhtmltopdf, it would be mismatched: - headers: - record 1 : good header - record 1 : empty header - record 2 : good header - bodies: - record 1 : body - record 2 : body - record 3 : body - footers: - record 1 : good footer - record 1 : empty footer - record 2 : good footer so record 2 will have empty header/footer, and record 3 will get those of record 2. opw-2507137 closes odoo/odoo#69703 X-original-commit: 90bdb5c7b7aa6a9b98e9acb1774d449ae65a3918 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
-rw-r--r--addons/l10n_latam_invoice_document/views/report_templates.xml16
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/l10n_latam_invoice_document/views/report_templates.xml b/addons/l10n_latam_invoice_document/views/report_templates.xml
index 97e92f67c72..261b892beb4 100644
--- a/addons/l10n_latam_invoice_document/views/report_templates.xml
+++ b/addons/l10n_latam_invoice_document/views/report_templates.xml
@@ -7,7 +7,7 @@
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
- <div t-attf-class="header o_company_#{company.id}_layout">
+ <div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
</div>
@@ -18,7 +18,7 @@
</div>
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" position="after">
- <div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout">
+ <div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
@@ -30,7 +30,7 @@
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
- <div t-attf-class="header o_company_#{company.id}_layout">
+ <div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<div class="o_clean_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
@@ -42,7 +42,7 @@
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" position="after">
- <div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout">
+ <div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
@@ -54,7 +54,7 @@
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="header o_company_#{company.id}_layout" position="after">
- <div t-attf-class="header o_company_#{company.id}_layout" >
+ <div t-attf-class="header o_company_#{company.id}_layout" t-if="custom_header">
<div class="o_boxed_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
@@ -66,7 +66,7 @@
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" position="after">
- <div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout">
+ <div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout" t-if="custom_footer">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>
@@ -78,7 +78,7 @@
<attribute name="t-if">not custom_header</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout header" position="after">
- <div t-attf-class="o_company_#{company.id}_layout header">
+ <div t-attf-class="o_company_#{company.id}_layout header" t-if="custom_header">
<div class="o_background_header">
<t t-if="custom_header" t-call="#{custom_header}"/>
</div>
@@ -90,7 +90,7 @@
<attribute name="t-if">not custom_footer</attribute>
</div>
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" position="after">
- <div t-attf-class="o_company_#{company.id}_layout footer o_background_footer">
+ <div t-attf-class="o_company_#{company.id}_layout footer o_background_footer" t-if="custom_footer">
<t t-if="custom_footer" t-raw="custom_footer"/>
</div>
</div>