Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
52
sale_fixed_discount/views/sale_portal_templates.xml
Executable file
52
sale_fixed_discount/views/sale_portal_templates.xml
Executable file
@@ -0,0 +1,52 @@
|
||||
<?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 >= 0 or line.fixed_discount >= 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 > 0" class="text-info">
|
||||
<t t-esc="line.discount_fixed" />
|
||||
</strong>
|
||||
</td>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user