[ADD]crm_channel: portal, Im not interested button go to next lead or to list if none

bzr revid: dle@openerp.com-20130620151805-pvjkozq41wwpfodo
This commit is contained in:
Denis Ledoux 2013-06-20 17:18:05 +02:00
parent c13e5b8c9a
commit 7be4614731
3 changed files with 23 additions and 2 deletions

View File

@ -52,6 +52,9 @@ You can also use the geolocalization without using the GPS coordinates.
'report/crm_partner_report_view.xml',
'data/lead_mail_template_data.xml',
],
'js': [
'static/src/js/next.js',
],
'test': ['test/partner_assign.yml'],
'installable': True,
'auto_install': False,

View File

@ -44,8 +44,14 @@ class crm_lead(osv.osv):
except ValueError:
stage_id = False
values = {}
# values = {'partner_assigned_id': False}
values = {'partner_assigned_id': False}
if stage_id:
values['stage_id'] = stage_id
self.write(cr, SUPERUSER_ID, ids, values, context=context)
self.message_post(cr, uid, ids, body=_('I am not interested by this lead'), context=context)
self.write(cr, SUPERUSER_ID, ids, values, context=context)
return {
'type': 'ir.actions.client',
'tag': 'next_or_list',
'params': {
},
}

View File

@ -0,0 +1,12 @@
openerp.crm_channel = function (instance) {
instance.crm_channel = instance.crm_channel || {};
instance.crm_channel.next_or_list = function(parent) {
var form = parent.inner_widget.views.form.controller;
form.dataset.remove_ids([form.dataset.ids[form.dataset.index]]);
form.reload();
if (!form.dataset.ids.length){
parent.inner_widget.switch_mode('list');
}
};
instance.web.client_actions.add("next_or_list", "instance.crm_channel.next_or_list");
}