Resolved the traceback in Events > Ticket Type tab, when the product is removed

This commit is contained in:
dhr-odoo 2014-06-13 18:01:57 +05:30
parent f15cbd6520
commit 05c007df00
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):