summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2016-04-11 10:36:42 +0200
committerGoffin Simon <sig@odoo.com>2016-04-12 10:38:31 +0200
commit0dbdbf136e1a1fb4e626a82a15363f3487bedd97 (patch)
tree6fa540dcd73a828c6a3ae8214124ebed306f39d5
parent67c444bb3871a9369f5b7cd2336765e248a61357 (diff)
[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
-rw-r--r--addons/website_quote/models/order.py12
1 files changed, 12 insertions, 0 deletions
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)