diff options
| author | Denis Ledoux <dle@odoo.com> | 2016-04-25 12:33:19 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2016-04-25 12:37:06 +0200 |
| commit | dc1b8a5a51dfabcdefcb5cbb8b7d5d141bb00e53 (patch) | |
| tree | 60b9d4e3534d4d68fbcf4f2ccb21f45eb04d673f | |
| parent | 0410d1187b3adae856c9ed3b0cce7bacf4079998 (diff) | |
[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
| -rw-r--r-- | openerp/addons/base/res/res_company.py | 11 |
1 files changed, 10 insertions, 1 deletions
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) |
