Merge lp:~openerp-dev/openobject-addons/6.1-opw-576325-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576325-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 29 lines (+12/-1)
1 file modified
base_contact/base_contact.py (+12/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-576325-ado
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Pending
Naresh(OpenERP) Pending
Review via email: mp+114368@code.launchpad.net

Description of the change

Hello,

[FIX] : lead does't save the res_partner_contact information with base_contact module

Steps :
1. create database then install crm
2. install base_contact
3. fill the fields title + mobile on the lead and try to save the lead values of this fields will disappear

The problem is occur when this fields are related not char.

Regards,
Amit Dodiya

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore i.e base_contact module is no more in 7). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6882. By Amit Dodiya<email address hidden>

[FIX] : lead does't save the res_partner_contact information with base_contact module

6881. By Amit Dodiya<email address hidden>

[FIX] : base_contact does not support lead_to_partner conversion(573096) ira's branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_contact/base_contact.py'
2--- base_contact/base_contact.py 2012-02-15 13:22:13 +0000
3+++ base_contact/base_contact.py 2012-07-11 09:24:36 +0000
4@@ -209,7 +209,9 @@
5 'name' : fields.related('contact_id', 'name', type='char', size=64, string="Contact Name", store=True),
6 'title' : fields.related('contact_id', 'title', type='many2one', relation='res.partner.title', string="Title", store=True),
7 }
8- def create(self, cr, uid, data, context={}):
9+ def create(self, cr, uid, data, context=None):
10+ if context is None:
11+ context = {}
12 if not data.get('location_id', False):
13 loc_id = self.pool.get('res.partner.location').create(cr, uid, {
14 'street': data.get('street',''),
15@@ -220,6 +222,15 @@
16 'state_id': data.get('state_id',False)
17 }, context=context)
18 data['location_id'] = loc_id
19+ if not data.get('contact_id', False) and data.get('name', False):
20+ con_id = self.pool.get('res.partner.contact').create(cr, uid, {
21+ 'last_name': data.get('name', ''),
22+ 'title': data.get('title', ''),
23+ 'partner_id': data.get('partner_id', False),
24+ 'function' : data.get('function', ''),
25+ 'mobile' : data.get('mobile', '')
26+ }, context=context)
27+ data['contact_id'] = con_id
28 result = super(res_partner_address, self).create(cr, uid, data, context=context)
29 return result
30