Merge pull request #522 from odoo-dev/saas-5-opw-609008-dhr

[FIX] event_sale: avoid traceback when remove product in onchange view
This commit is contained in:
Martin Trigaux 2014-06-13 16:12:27 +02:00
commit cd95dc1a8f
1 changed files with 2 additions and 1 deletions

View File

@ -245,7 +245,8 @@ class event_ticket(osv.osv):
]
def onchange_product_id(self, cr, uid, ids, product_id=False, context=None):
return {'value': {'price': self.pool.get("product.product").browse(cr, uid, product_id).list_price or 0}}
price = self.pool.get("product.product").browse(cr, uid, product_id).list_price if product_id else 0
return {'value': {'price': price}}
class event_registration(osv.osv):