[FIX] delivery: discount pricelist bug
If user created pricelist which applied discount on fixed prize delivery and set the discount visibilty to be shown in sale order, the discount would be applied twice. Due to stable version limitation, the visibility of discount on sale order for pricelist discount for delivery is removed. opw-3517879 closes odoo/odoo#154663 X-original-commit: f96ce5102aea5651710bb5bf50903b1c1d4f101e Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com> Signed-off-by: anko-odoo <anko@odoo.com>
This commit is contained in:
@@ -46,3 +46,8 @@ class SaleOrderLine(models.Model):
|
||||
|
||||
undeletable_lines = super()._check_line_unlink()
|
||||
return undeletable_lines.filtered(lambda line: not line.is_delivery)
|
||||
|
||||
def _compute_pricelist_item_id(self):
|
||||
delivery_lines = self.filtered('is_delivery')
|
||||
super(SaleOrderLine, self - delivery_lines)._compute_pricelist_item_id()
|
||||
delivery_lines.pricelist_item_id = False
|
||||
|
||||
@@ -168,6 +168,7 @@ class TestDeliveryCost(common.TransactionCase):
|
||||
'applied_on': '0_product_variant',
|
||||
'product_id': self.normal_delivery.product_id.id,
|
||||
})],
|
||||
'discount_policy': 'without_discount',
|
||||
})
|
||||
|
||||
# Create sales order with Normal Delivery Charges
|
||||
|
||||
Reference in New Issue
Block a user