From 0dbdbf136e1a1fb4e626a82a15363f3487bedd97 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 11 Apr 2016 10:36:42 +0200 Subject: [PATCH] [FIX] website_quote: onchange for product with sale.quote.option The on_change_product_id defined for sale.quote.option has been removed in the form view. opw:673285 --- addons/website_quote/models/order.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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)