Skip to content
Snippets Groups Projects
Commit af8cc475 authored by Walid HANNICHE (waha)'s avatar Walid HANNICHE (waha)
Browse files

[FIX] sale_coupon: move all discounts to the end of the sale_order

update to this PR[1]

BUG:
some discounts are still displayed on the middle of the order

FIX:
move all discounts to the end

[1]:https://github.com/odoo/odoo/pull/102700


opw-2985632

closes odoo/odoo#106322

Signed-off-by: default avatarWilliam Braeckman (wbr) <wbr@odoo.com>
parent 877059b2
No related branches found
No related tags found
No related merge requests found
......@@ -393,9 +393,8 @@ class SaleOrder(models.Model):
def update_line(order, lines, values):
'''Update the lines and return them if they should be deleted'''
lines_to_remove = self.env['sale.order.line']
# move global coupons to the end of the SO
if program.discount_apply_on == 'on_order':
values['sequence'] = max(order.order_line.mapped('sequence')) + 1
# move coupons to the end of the SO
values['sequence'] = max(order.order_line.mapped('sequence')) + 1
# Check commit 6bb42904a03 for next if/else
# Remove reward line if price or qty equal to 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment