[FIX] hr_timesheet_invoice: on_change_partner_id, do nothing if partner_id is False

bzr revid: dle@openerp.com-20140113165647-152dy1wqgc7m8cc8
This commit is contained in:
Denis Ledoux 2014-01-13 17:56:47 +01:00
parent 892f1d5fe5
commit fb7aefa5c3
1 changed files with 5 additions and 4 deletions

View File

@ -77,10 +77,11 @@ class account_analytic_account(osv.osv):
def on_change_partner_id(self, cr, uid, ids, partner_id, name, context=None):
res = super(account_analytic_account, self).on_change_partner_id(cr, uid, ids, partner_id, name, context=context)
part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
if pricelist:
res['value']['pricelist_id'] = pricelist
if partner_id:
part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
if pricelist:
res['value']['pricelist_id'] = pricelist
return res
def set_close(self, cr, uid, ids, context=None):