[FIX] base: by default a company is not a customer

When creating a company, a new partner is created with his field
'customer' = True. But by default a company doesn't have to be
a customer.

opw:667130
This commit is contained in:
Goffin Simon 2016-01-19 13:19:11 +01:00
parent 6f28b70171
commit c0571d4066
1 changed files with 1 additions and 1 deletions

View File

@ -276,7 +276,7 @@ class res_company(osv.osv):
self.cache_restart(cr)
return super(res_company, self).create(cr, uid, vals, context=context)
obj_partner = self.pool.get('res.partner')
partner_id = obj_partner.create(cr, uid, {'name': vals['name'], 'is_company':True, 'image': vals.get('logo', False)}, context=context)
partner_id = obj_partner.create(cr, uid, {'name': vals['name'], 'is_company':True, 'image': vals.get('logo', False), 'customer': False}, context=context)
vals.update({'partner_id': partner_id})
self.cache_restart(cr)
company_id = super(res_company, self).create(cr, uid, vals, context=context)