[FIX] leads merge feature
bzr revid: abo@openerp.com-20120927134513-pi9wr5vt0f02bqsu
This commit is contained in:
parent
4416badf97
commit
22d2823e74
|
@ -88,7 +88,7 @@
|
|||
|
||||
<act_window id="action_crm_send_mass_convert"
|
||||
multi="True"
|
||||
key2="client_action_multi" name="Convert opportunities"
|
||||
key2="client_action_multi" name="Convert to opportunities"
|
||||
res_model="crm.lead2opportunity.partner.mass" src_model="crm.lead"
|
||||
view_mode="form" target="new" view_type="form"
|
||||
context="{'mass_convert' : True}"
|
||||
|
|
|
@ -27,6 +27,8 @@ class crm_merge_opportunity(osv.osv_memory):
|
|||
_description = 'Merge two Opportunities'
|
||||
|
||||
def action_merge(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
lead = self.pool.get('crm.lead')
|
||||
record = self.browse(cr, uid, ids[0], context=context)
|
||||
opportunities = record.opportunity_ids
|
||||
|
@ -38,7 +40,7 @@ class crm_merge_opportunity(osv.osv_memory):
|
|||
return lead.redirect_opportunity_view(cr, uid, merge_id, context=context)
|
||||
|
||||
_columns = {
|
||||
'opportunity_ids' : fields.many2many('crm.lead', 'merge_opportunity_rel', 'merge_id', 'opportunity_id', 'Opportunities', domain=[('type', '=', 'opportunity')]),
|
||||
'opportunity_ids': fields.many2many('crm.lead', rel='merge_opportunity_rel', id1='merge_id', id2='opportunity_id', string='Leads/Opportunities'),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<field name="name">crm.merge.opportunity.form</field>
|
||||
<field name="model">crm.merge.opportunity</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Merge Opportunities" version="7.0">
|
||||
<separator string="Select Opportunities"/>
|
||||
<form string="Merge Leads/Opportunities" version="7.0">
|
||||
<separator string="Select Leads/Opportunities"/>
|
||||
<field name="opportunity_ids">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
<footer>
|
||||
<button name="action_merge" type="object" string="_Merge" class="oe_highlight"/>
|
||||
<button name="action_merge" type="object" string="Merge" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
|
@ -26,9 +26,9 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Merge Opportunities action -->
|
||||
<!-- Merge leads/opportunities action -->
|
||||
<record model="ir.actions.act_window" id="merge_opportunity_act">
|
||||
<field name="name">Merge Opportunities</field>
|
||||
<field name="name">Merge leads/opportunities</field>
|
||||
<field name="res_model">crm.merge.opportunity</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
<act_window id="action_merge_opportunities"
|
||||
multi="True"
|
||||
key2="client_action_multi" name="Merge Opportunities"
|
||||
key2="client_action_multi" name="Merge leads/opportunities"
|
||||
res_model="crm.merge.opportunity" src_model="crm.lead"
|
||||
view_mode="form" target="new" view_type="form"/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue