Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
14
sale_fixed_discount/views/account_invoice_views.xml
Executable file
14
sale_fixed_discount/views/account_invoice_views.xml
Executable file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<!-- Update account invoice !-->
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="name">account.move - </field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account_invoice_fixed_discount.view_move_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="discount_fixed" position="attributes">
|
||||
<attribute name="groups">sale.group_discount_per_so_line</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
24
sale_fixed_discount/views/sale_order_views.xml
Executable file
24
sale_fixed_discount/views/sale_order_views.xml
Executable file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-20 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="name">sale.order.form - sale_fixed_discount</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/form//label[@for='discount']"
|
||||
position="before"
|
||||
>
|
||||
<field name="discount_fixed" groups="sale.group_discount_per_so_line" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/list/field[@name='discount']"
|
||||
position="before"
|
||||
>
|
||||
<field name="discount_fixed" groups="sale.group_discount_per_so_line" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
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