[FIX] portal_claim: create claim with no partner_id

If partner_id is False, do not try to name_get

This fix is related to the rev 095be21ab1
This commit is contained in:
Denis Ledoux 2014-08-12 14:13:44 +02:00
parent 245bb4ebdf
commit 0d22a34fa9
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class crm_claim(base_stage, osv.osv):
def default_get(self, cr, uid, fields, context=None):
res = super(crm_claim, self).default_get(cr, uid, fields, context=context)
if isinstance(res.get('partner_id'), (int, long)):
if type(res.get('partner_id')) in (int, long):
# Special case for portal users, as they are not allowed to call name_get on res.partner
# We save this call for the web client by returning it in default get
res['partner_id'] = self.pool['res.partner'].name_get(