[FIX] sale: onchange on sale order line to set customer lead time

This would lead delivery orders not to be too late by default
and a correct scheduled date on the procurement
This commit is contained in:
Josse Colpaert
2015-09-30 20:54:47 +02:00
parent c3c2281a4d
commit 3c0be6b60a
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -498,6 +498,11 @@ class SaleOrderLine(models.Model):
for line in self:
line.price_reduce = line.price_subtotal / line.product_uom_qty if line.product_uom_qty else 0.0
@api.onchange('product_id')
def _onchange_product_id(self):
for line in self:
line.customer_lead = line.product_id and line.product_id.sale_delay or 0.0
@api.multi
@api.onchange('order_id', 'product_id')
def _compute_tax_id(self):
+1
View File
@@ -259,6 +259,7 @@
<field name="qty_delivered_updateable" invisible="1"/>
<field name="state" invisible="1"/>
<field name="invoice_status" invisible="1"/>
<field name="customer_lead" invisible="1"/>
</tree>
<kanban class="o_kanban_mobile">
<field name="product_id"/>