Skip to content

Commit

Permalink
[MIG] sale_discount_display_amount: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Tran committed Feb 3, 2025
1 parent eb89cb8 commit 453619b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 83 deletions.
3 changes: 3 additions & 0 deletions checklog-odoo.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[checklog-odoo]
ignore=
WARNING.* 0 failed, 0 error\(s\).*
2 changes: 1 addition & 1 deletion sale_discount_display_amount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"summary": """
This addon intends to display the amount of the discount computed on
sale_order_line and sale_order level""",
"version": "17.0.1.1.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
inherit_id="sale.report_saleorder_document"
>
<xpath expr="//div[@id='total']//table" position="inside">
<t groups="product.group_discount_per_so_line" t-if="doc.discount_total">
<t groups="sale.group_discount_per_so_line" t-if="doc.discount_total">
<t
t-set="is_discount"
t-value="doc.company_id.report_total_without_discount and doc.price_total_no_discount != doc.amount_total"
Expand Down
53 changes: 25 additions & 28 deletions sale_discount_display_amount/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<field name="model">sale.order</field>
<field name="arch" type="xml">
<xpath
expr="//field[@name='order_line']//tree//field[@name='discount']"
expr="//field[@name='order_line']//list//field[@name='discount']"
position="after"
>
<field name="price_subtotal_no_discount" optional="hide" />
Expand All @@ -14,37 +14,34 @@
</field>
</record>
<record id="sale_order_view_form_display_discount" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="model">sale.order</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='tax_totals']" position="after">
<field
name="display_discount_with_tax"
invisible="1"
position="attributes"
/>
<field
name="price_subtotal_no_discount"
invisible="display_discount_with_tax == True"
position="attributes"
/>
<field
name="discount_subtotal"
invisible="display_discount_with_tax == True"
position="attributes"
/>
<field
name="price_total_no_discount"
invisible="display_discount_with_tax == False"
position="attributes"
/>
<field
name="discount_total"
invisible="display_discount_with_tax == False"
position="attributes"
/>
<xpath expr="//group[@name='sale_total']" position="after">
<group
class="oe_subtotal_footer d-flex order-0 order-lg-1 flex-column gap-0 gap-sm-3"
colspan="2"
name="sale_discount_total"
>
<div class="d-flex" invisible="display_discount_with_tax">
<label for="price_subtotal_no_discount" />
<field name="price_subtotal_no_discount" nolabel="1" />
</div>
<div class="d-flex" invisible="display_discount_with_tax">
<label for="discount_subtotal" />
<field name="discount_subtotal" nolabel="1" />
</div>
<div class="d-flex" invisible="not display_discount_with_tax">
<label for="price_total_no_discount" />
<field name="price_total_no_discount" nolabel="1" />
</div>
<div class="d-flex" invisible="not display_discount_with_tax">
<label for="discount_total" />
<field name="discount_total" nolabel="1" />
</div>
</group>
</xpath>
</data>
</field>
Expand Down

0 comments on commit 453619b

Please sign in to comment.