Files
Odoo-18.0-20251222/sale_fixed_discount/views/sale_portal_templates.xml
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

53 lines
2.0 KiB
XML
Executable File

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="sale_order_portal_content"
inherit_id="sale.sale_order_portal_content"
>
<xpath
expr="//section[@id='details']//t[@t-set='display_discount']"
position="after"
>
<t
t-set="display_discount_fixed"
t-value="True in [line.discount_fixed > 0 for line in sale_order.order_line]"
/>
</xpath>
<xpath
expr="//section[@id='details']//table/thead//th[@t-if='display_discount']"
position="before"
>
<th
t-if="display_discount_fixed"
t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}"
>
<span>Disc. Fixed Amount</span>
</th>
</xpath>
<xpath expr="//div[@t-field='line.price_unit']" position="attributes">
<attribute
name="t-if"
>line.discount &gt;= 0 or line.fixed_discount &gt;= 0</attribute>
<attribute
name="t-att-style"
>(line.discount or line.discount_fixed) and 'text-decoration: line-through' or None</attribute>
<attribute
name="t-att-class"
>((line.discount or line.discount_fixed) and 'text-danger' or '') + ' text-right'</attribute>
</xpath>
<xpath expr="//div[@t-if='line.discount']/t" position="attributes">
<attribute name="t-out">line.price_unit - line.discount_fixed</attribute>
</xpath>
<xpath expr="//td[@t-if='display_discount']" position="before">
<td
t-if="display_discount_fixed"
t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}"
>
<strong t-if="line.discount_fixed &gt; 0" class="text-info">
<t t-esc="line.discount_fixed" />
</strong>
</td>
</xpath>
</template>
</odoo>