From dc1b8a5a51dfabcdefcb5cbb8b7d5d141bb00e53 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 25 Apr 2016 12:33:19 +0200 Subject: [PATCH] [FIX] res_company: some information missed on company creation On the `res.company` model, the fields `name`, `phone`, `email`, `website`, `vat` are related field on the `partner_id` of the company. When creating a new company, the partner associated to the company is created automatically, it's handled in the overrided `create` method of the model, but it forgots the values `phone`, `email`, `website`, `vat` at the moment the partner is being created. opw-675526 --- openerp/addons/base/res/res_company.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_company.py b/openerp/addons/base/res/res_company.py index 3b8464e20b6..71995487cf1 100644 --- a/openerp/addons/base/res/res_company.py +++ b/openerp/addons/base/res/res_company.py @@ -276,7 +276,16 @@ 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), 'customer': False}, context=context) + partner_id = obj_partner.create(cr, uid, { + 'name': vals['name'], + 'is_company': True, + 'image': vals.get('logo', False), + 'customer': False, + 'email': vals.get('email'), + 'phone': vals.get('phone'), + 'website': vals.get('website'), + 'vat': vals.get('vat'), + }, context=context) vals.update({'partner_id': partner_id}) self.cache_restart(cr) company_id = super(res_company, self).create(cr, uid, vals, context=context)