[FIX] sale, sale_stock, website_quote: delivery lead time with website quote
The related customer_lead of each product in a SO line must be set when a quotation template is used in a SO. opw:671938
This commit is contained in:
@@ -142,6 +142,10 @@ class SaleOrder(models.Model):
|
|||||||
|
|
||||||
product_id = fields.Many2one('product.product', related='order_line.product_id', string='Product')
|
product_id = fields.Many2one('product.product', related='order_line.product_id', string='Product')
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _get_customer_lead(self, product_tmpl_id):
|
||||||
|
return False
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def button_dummy(self):
|
def button_dummy(self):
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -88,6 +88,11 @@ class SaleOrder(models.Model):
|
|||||||
res.update({'move_type': self.picking_policy, 'partner_id': self.partner_shipping_id.id})
|
res.update({'move_type': self.picking_policy, 'partner_id': self.partner_shipping_id.id})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _get_customer_lead(self, product_tmpl_id):
|
||||||
|
super(SaleOrder, self)._get_customer_lead(product_tmpl_id)
|
||||||
|
return product_tmpl_id.sale_delay
|
||||||
|
|
||||||
class SaleOrderLine(models.Model):
|
class SaleOrderLine(models.Model):
|
||||||
_inherit = 'sale.order.line'
|
_inherit = 'sale.order.line'
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ class sale_order(osv.osv):
|
|||||||
'product_uom': line.product_uom_id.id,
|
'product_uom': line.product_uom_id.id,
|
||||||
'website_description': line.website_description,
|
'website_description': line.website_description,
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
|
'customer_lead': self._get_customer_lead(cr, uid, line.product_id.product_tmpl_id),
|
||||||
})
|
})
|
||||||
lines.append((0, 0, data))
|
lines.append((0, 0, data))
|
||||||
options = []
|
options = []
|
||||||
|
|||||||
Reference in New Issue
Block a user