[IMP] CRM: Merge opportunities by Wizard record - Optimize Code

bzr revid: aag@tinyerp.com-20111206132021-a8a88ocplpj4ygvs
This commit is contained in:
Atik Agewan (OpenERP)
2011-12-06 18:50:21 +05:30
parent 8889e1ba68
commit 7d6e5d09b7
@@ -13,17 +13,13 @@
res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
self.make_opportunity(cr, uid, [res_id], context=context)
-
For merge all opportunities of customer.
Now I merge all opportunities of customer.
-
!python {model: crm.lead}: |
opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
context.update({'active_model': 'crm.lead','active_ids': opportunity_ids})
-
I create record for merge.
-
!record {model: crm.merge.opportunity, id: opportunity_merge_id }:
-
I Merged opportunities of customer..
-
!python {model: crm.merge.opportunity}: |
self.action_merge(cr, uid, [ref("opportunity_merge_id")], context=context)