[FIX] sale_product_matrix: Apply discount on line

Before this commit, Discount on SO line was never applied as '_onchange_discount' was not called.

In this commit, We call the method explicitly to set a discount on SO line.
Fixes https://github.com/odoo/odoo/issues/43970

closes odoo/odoo#43994

X-original-commit: 10fa3940bc7b28d20e7aac04e154fbcdfda69e56
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Swapnesh Shah
2020-01-27 11:42:05 +00:00
committed by GitHub
parent d1a0601660
commit 751831e5ff
@@ -106,6 +106,8 @@ class SaleOrder(models.Model):
self.update(dict(order_line=new_lines))
for line in self.order_line.filtered(lambda line: line.product_template_id == product_template):
line.product_id_change()
line._onchange_discount()
def _get_matrix(self, product_template):
"""Return the matrix of the given product, updated with current SOLines quantities.