diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py index 55648f23f03..2c3825a598f 100644 --- a/addons/website_quote/models/order.py +++ b/addons/website_quote/models/order.py @@ -328,6 +328,18 @@ class sale_quote_option(osv.osv): 'quantity': 1, } + @api.onchange('product_id') + def _onchange_product_id(self): + if not self.product_id: + return + product = self.product_id + self.price_unit = product.list_price + self.website_description = product.product_tmpl_id.quote_description + self.name = product.name + self.uom_id = product.uom_id + domain = {'uom_id': [('category_id', '=', self.product_id.uom_id.category_id.id)]} + return {'domain': domain} + def on_change_product_id(self, cr, uid, ids, product, uom_id=None, context=None): vals, domain = {}, [] product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)