Merge lp:~openerp-dev/openobject-addons/7.0-opw-594808-ado into lp:openobject-addons/7.0

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-594808-ado
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+5/-2)
2 files modified
crm/crm_lead.py (+4/-1)
crm/crm_lead_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-594808-ado
Reviewer Review Type Date Requested Status
Xavier ALT Pending
Naresh(OpenERP) Pending
Review via email: mp+173653@code.launchpad.net

Description of the change

Hello,

[FIX]crm_lead: (1) title field always shows the titles of type contact it should show the titles based on customers is_company field (2) while creating the title from lead it always create title for type partner not based on customers is_company field

Issue 1:
While creating title for customer from Lead/Customer form it always create title with domain contact, it should be created based on customers type(contact/partner).
Steps:
1). Create new lead with customer agrolait as it is of type partner OR Create new customer set the is_company field true
2). Now create new title
It should create the title for type partner but it always creates title for type contact

Issue 2:
The title field always shows the title of type contact, it should shows the title based on customer types
Steps:
1). Create new lead with customer agrolait as it is of type company
2). Click on title field you will find the title of type contact

The solution contains two side fix server and addons.
The server side fix for this issue is : https://code.launchpad.net/~openerp-dev/openobject-server/7.0-opw-591029-pna/+merge/160059

Regards,
Amit Dodiya

To post a comment you must log in.

Unmerged revisions

9288. By Amit Dodiya (OpenERP)

[FIX]crm_lead: (1) title field always shows the titles of type contact it should show the titles based on customers is_company field (2) while creating the title from lead it always create title for type partner not based on customers is_company field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/crm_lead.py'
2--- crm/crm_lead.py 2013-06-19 11:46:33 +0000
3+++ crm/crm_lead.py 2013-07-09 06:48:27 +0000
4@@ -341,8 +341,11 @@
5 def on_change_partner(self, cr, uid, ids, partner_id, context=None):
6 result = {}
7 values = {}
8+ domain = {}
9 if partner_id:
10 partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
11+ dom_value = 'partner' if partner.is_company else 'contact'
12+ domain = {'title': [('domain', '=', dom_value)]}
13 values = {
14 'partner_name' : partner.name,
15 'street' : partner.street,
16@@ -355,7 +358,7 @@
17 'mobile' : partner.mobile,
18 'fax' : partner.fax,
19 }
20- return {'value' : values}
21+ return {'value' : values, 'domain': domain}
22
23 def on_change_user(self, cr, uid, ids, user_id, context=None):
24 """ When changing the user, also set a section_id or restrict section id
25
26=== modified file 'crm/crm_lead_view.xml'
27--- crm/crm_lead_view.xml 2013-06-21 12:06:09 +0000
28+++ crm/crm_lead_view.xml 2013-07-09 06:48:27 +0000
29@@ -137,7 +137,7 @@
30 <label for="contact_name"/>
31 <div>
32 <field name="contact_name" class="oe_inline"/><span attrs="{'invisible': [('title', '=', '')]}">, </span>
33- <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
34+ <field name="title" placeholder="Title" context="{'partner_id': partner_id}" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
35 </div>
36 <field name="email_from" widget="email"/>
37 <field name="function"/>