[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:
Goffin Simon
2016-03-21 09:43:32 +01:00
parent 528db2b306
commit a706ada628
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -142,6 +142,10 @@ class SaleOrder(models.Model):
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
def button_dummy(self):
return True
+5
View File
@@ -88,6 +88,11 @@ class SaleOrder(models.Model):
res.update({'move_type': self.picking_policy, 'partner_id': self.partner_shipping_id.id})
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):
_inherit = 'sale.order.line'
+1
View File
@@ -216,6 +216,7 @@ class sale_order(osv.osv):
'product_uom': line.product_uom_id.id,
'website_description': line.website_description,
'state': 'draft',
'customer_lead': self._get_customer_lead(cr, uid, line.product_id.product_tmpl_id),
})
lines.append((0, 0, data))
options = []