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

Proposed by Amit Dodiya (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6961
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-578303-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 38 lines (+11/-10)
1 file modified
crm/wizard/crm_partner_to_opportunity.py (+11/-10)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-578303-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Amit Dodiya (OpenERP) (community) Needs Resubmitting
Review via email: mp+120725@code.launchpad.net

Description of the change

Hello,

"[FIX] when we select more than one partner for creating opportunity in customers list the wizard will creates the opportunities with wrong data"

Stpes:
1). Install CRM module
2). Open Customers list view and select more than customers
3). Now click on "Create Opportunity" action so the wizard will open which contains the wrong "Opportunity Name"(name of first Partner) & "Partner"(partner_id of Last Partner) and also creates the opporunity with same wrong data.

It should creates the opportunities with selected customers data.

Regards,
Amit Dodiya

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

seems ok . just you forgot to remove the unused code partner_id = partner_ids[0] if partner_ids else None

review: Needs Fixing
Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hello,

Code is changed as per suggestion.

Thanks,
Amit Dodiya

review: Needs Resubmitting
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). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

6961. By Amit Dodiya<email address hidden>

[FIX] when we select more than one partner for creating opportunity in customers list the wizard will creates the opportunities with wrong data

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/wizard/crm_partner_to_opportunity.py'
2--- crm/wizard/crm_partner_to_opportunity.py 2011-12-22 09:10:55 +0000
3+++ crm/wizard/crm_partner_to_opportunity.py 2012-08-23 08:55:29 +0000
4@@ -53,23 +53,24 @@
5 if 'name' in fields:
6 res.update({'name': partner.name})
7 if 'partner_id' in fields:
8- res.update({'partner_id': data and data[0] or False})
9+ res.update({'partner_id': partner.id or False})
10 return res
11
12 def make_opportunity(self, cr, uid, ids, context=None):
13 partner_ids = context and context.get('active_ids', []) or []
14- partner_id = partner_ids[0] if partner_ids else None
15 partner = self.pool.get('res.partner')
16 lead = self.pool.get('crm.lead')
17 data = self.browse(cr, uid, ids, context=context)[0]
18- opportunity_ids = partner.make_opportunity(cr, uid, partner_ids,
19- data.name,
20- data.planned_revenue,
21- data.probability,
22- partner_id,
23- context=context,
24- )
25- opportunity_id = opportunity_ids[partner_ids[0]]
26+ partner_records = partner.browse(cr, uid, partner_ids, context=context)
27+ for record in partner_records:
28+ opportunity_ids = partner.make_opportunity(cr, uid, [record.id],
29+ record.name,
30+ data.planned_revenue,
31+ data.probability,
32+ record.id,
33+ context=context,
34+ )
35+ opportunity_id = opportunity_ids[record.id]
36 return lead.redirect_opportunity_view(cr, uid, opportunity_id, context=context)
37
38 crm_partner2opportunity()