[FIX] sale, sale_prodcut_matrix: Default customer Lead Time not set with Order Grid Entry

Steps to reproduce the bug:

- Let's consider a product P with three variants red, yellow and blue
- Let's set a customer lead time on P = 10 days
- Set Order Grid Entry on P
- Create a quotation Q and add P
- In the grid entry matrix add 1 red, 1 yellow and 1 blue

Bug:

The customer lead time of these three variants were not set on the lines.

opw:2337049

closes odoo/odoo#58675

X-original-commit: 0eae213d6c8a656ab2c045995e1f0643ff65df51
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2020-09-28 12:45:08 +00:00
parent 15d6e0f47b
commit caa4ca7cc1
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -1713,6 +1713,9 @@ class SaleOrderLine(models.Model):
'tax_id', 'analytic_tag_ids'
]
def _onchange_product_id_set_customer_lead(self):
pass
@api.onchange('product_id', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id')
def _onchange_discount(self):
if not (self.product_id and self.product_uom and
@@ -113,6 +113,7 @@ class SaleOrder(models.Model):
for line in self.order_line.filtered(lambda line: line.product_template_id == product_template):
line.product_id_change()
line._onchange_discount()
line._onchange_product_id_set_customer_lead()
def _get_matrix(self, product_template):