[FIX] web: remove bg img when layout bg is Blank

Currently, the boxed and striped document layouts still pass in the
default background image when set to Blank. This image is mostly hidden, but
displays artifacts when printing or changing background color in program
like Paint. This fix removes the background image from these layouts when
"Layout Background" is set to "Blank".

In v15, Odoo changed the way that Document Layouts can be configured by
allowing the Geometric background image to be set on any of the base layouts.
A conditional was added to the standard and bold layouts to check the
selection for the "Layout Background" setting, and to set an empty string
for Blank. This conditional is missing for boxed and striped, causing
the artifacting issue. This fix adds in that conditional, which
removes the artifacting.

opw-3232991

closes odoo/odoo#118921

X-original-commit: 92f28da10e4fa3c80be0759c131febb5e6289e20
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit is contained in:
jobl
2023-04-19 07:40:24 +02:00
parent 245e174eb6
commit db07dbdf32
+2 -2
View File
@@ -312,7 +312,7 @@
</div>
</div>
<div t-attf-class="o_company_#{company.id}_layout article o_report_layout_striped {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' }});" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<div t-attf-class="o_company_#{company.id}_layout article o_report_layout_striped {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''}});" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-out="0"/>
</div>
@@ -349,7 +349,7 @@
</div>
</div>
<div t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' }});" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<div t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''}});" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<div class="pt-5">
<!-- This div ensures that the address is not cropped by the header. -->
<t t-call="web.address_layout"/>