Skip to content

Commit

Permalink
[16.0][IMP] sale_global_discount: Remake amount global discount
Browse files Browse the repository at this point in the history
  • Loading branch information
Rferri44-S73 committed Jun 21, 2023
1 parent cdf5cee commit b64ca36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sale_global_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Global Discount",
"version": "16.0.1.0.0",
"version": "16.0.1.0.1",
"category": "Sales Management",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
Expand Down
8 changes: 5 additions & 3 deletions sale_global_discount/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ def _compute_amounts(self):
discounts = order.global_discount_ids.mapped("discount")
amount_discounted_untaxed = amount_discounted_tax = 0
for line in order.order_line:
discounted_subtotal = self.get_discounted_global(
line.price_subtotal, discounts.copy()
)
discounted_subtotal = line.price_subtotal
if line.product_id.apply_global_discount:
discounted_subtotal = self.get_discounted_global(
line.price_subtotal, discounts.copy()
)
amount_discounted_untaxed += discounted_subtotal
discounted_tax = line.tax_id.compute_all(
discounted_subtotal,
Expand Down

0 comments on commit b64ca36

Please sign in to comment.