OpenERP Addons (modules)

base_contact wrong creation of res.partner.address record

Reported by Gustavo Adrian Marino on 2012-02-21
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Addons
Low
OpenERP R&D Addons Team 1

Bug Description

In V6.1, with crm and base_contact installed: when you convert a lead into an opportunity, the contact information is lost, and the created res.partner.address has no associated res.partner.contact (name, mobile and title info is lost)

The reason is an error on module base_contact, not creating the record on create method overwrite

For sure is impacting on any module thats creates partner addresses not aware of base_contact.

Correction is attached:

=== modified file 'base_contact/base_contact.py'
--- base_contact/base_contact.py 2012-02-15 13:22:13 +0000
+++ base_contact/base_contact.py 2012-02-21 22:22:13 +0000
@@ -220,6 +220,30 @@
                 'state_id': data.get('state_id',False)
             }, context=context)
             data['location_id'] = loc_id
+ if not data.get('contact_id', False):
+ first_name = ''
+ last_name = ''
+ if data.get('name', False):
+ name = data.get('name','').strip()
+ words = name.split(",")
+ if len(words) > 1:
+ last_name = words[0].strip()
+ first_name = ",".join(words[1:]).strip()
+ else:
+ words = name.split(" ")
+ if len(words) == 1:
+ last_name = words[0].strip()
+ first_name = ''
+ else:
+ first_name = words[0].strip()
+ last_name = " ".join(words[1:]).strip()
+ contact_id = self.pool.get('res.partner.contact').create(cr, uid, {
+ 'mobile': data.get('mobile',''),
+ 'title': data.get('title',''),
+ 'first_name': first_name,
+ 'last_name': last_name,
+ }, context=context)
+ data['contact_id'] = contact_id
         result = super(res_partner_address, self).create(cr, uid, data, context=context)
         return result

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
Stuart Longland (redhatter) wrote :

Could you attach this as a separate file to the bug? Launchpad has no respect for whitespace, and Python has no respect for those who don't indent. :-)

Dear Stuart,

I attached the patch to the bug reported by Julien:
https://bugs.launchpad.net/openobject-addons/+bug/940264

Thanks for reviewing and adding to "our" joint branch
https://code.launchpad.net/~vrt-openerp/openobject-addons/6.1-trunk-bug-923440

Best Regards

Etienne

On 06.03.2012 07:59, Stuart Longland wrote:
> Could you attach this as a separate file to the bug? Launchpad has no
> respect for whitespace, and Python has no respect for those who don't
> indent. :-)
>

Hello,

base_contact module is removed from latest trunk.

Thanks

Changed in openobject-addons:
status: Confirmed → Invalid
Etienne Hirt (hirt) wrote :

Dear Turkesh,

What is the future of base_contact? Is it moved to extra addons?

Please provide me some insight.

Thanks

Etienne

On 16.04.2012 14:58, Turkesh Patel (openERP) wrote:
> Hello,
>
> base_contact module is removed from latest trunk.
>
> Thanks
>
>
> ** Changed in: openobject-addons
> Status: Confirmed => Invalid
>

--
++++++++++++++++++++++++++++++++++++++++++++++
Dr. Etienne Hirt Art of Technology
Director R&D www.art-of-technology.ch
Technoparkstrasse 1 Ph: +41-43-311 77 02
8005 Zurich Sw: +41-43-311 77 00
Switzerland Skype: etiennehirt
==============================================

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers