From 3fb3b9bf6b662832baef3439162f9d5c0843fd13 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 19 Nov 2012 15:03:10 +0530 Subject: [PATCH 1/8] [IMP] add subtype of crm lead bzr revid: fka@tinyerp.com-20121119093310-jj3mn6vq2466bc6d --- addons/crm/crm_data.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index f2bf56e34ac..31ad28e78a4 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -70,5 +70,25 @@ {'type':'lead'} + + + Convert to Opportunity + crm.lead + + + + Stage Changed + crm.lead + + + + Lost + crm.lead + + + + Won + crm.lead + From 979ca89a861daf2bac06dfc2e3e720ed8e27e7a9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 19 Nov 2012 15:12:34 +0530 Subject: [PATCH 2/8] [IMP] add subtype of Quotation / Sales Order bzr revid: fka@tinyerp.com-20121119094234-610wmtg9fpyvoyrw --- addons/sale/sale_data.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index 3fe03966da2..89e1e7ed56c 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -43,5 +43,16 @@ This application lets you create and send quotations and process your sales orders; from delivery to invoicing.

If you need to manage your sales pipeline (leads, opportunities, phonecalls), the CRM application may be useful. Use the Settings menu to install it.

]]>
+ + + + Quotation sent + sale.order + + + + Sale Order Confirmed + sale.order + From 5c17ed60e6cdd6682b9b1bbe6b4b95722f59a578 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 19 Nov 2012 16:44:38 +0530 Subject: [PATCH 3/8] [IMP] improve code bzr revid: fka@tinyerp.com-20121119111438-xobjmirj0wfq15pn --- addons/crm/crm_data.xml | 20 -------------------- addons/crm/crm_lead.py | 8 ++++---- addons/crm/crm_lead_data.xml | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index 31ad28e78a4..f2bf56e34ac 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -70,25 +70,5 @@ {'type':'lead'} - - - Convert to Opportunity - crm.lead - - - - Stage Changed - crm.lead - - - - Lost - crm.lead - - - - Won - crm.lead - diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 547b25af27c..fe6de3e76ae 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -847,7 +847,7 @@ class crm_lead(base_stage, format_address, osv.osv): def stage_set_send_note(self, cr, uid, ids, stage_id, context=None): """ Override of the (void) default notification method. """ stage_name = self.pool.get('crm.case.stage').name_get(cr, uid, [stage_id], context=context)[0][1] - return self.message_post(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), context=context) + return self.message_post(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype="crm.mt_lead_stage", context=context) def case_get_note_msg_prefix(self, cr, uid, lead, context=None): if isinstance(lead, (int, long)): @@ -862,11 +862,11 @@ class crm_lead(base_stage, format_address, osv.osv): def case_mark_lost_send_note(self, cr, uid, ids, context=None): message = _("Opportunity has been lost.") - return self.message_post(cr, uid, ids, body=message, context=context) + return self.message_post(cr, uid, ids, body=message, subtype="crm.mt_lead_lost", context=context) def case_mark_won_send_note(self, cr, uid, ids, context=None): message = _("Opportunity has been won.") - return self.message_post(cr, uid, ids, body=message, context=context) + return self.message_post(cr, uid, ids, body=message, subtype="crm.mt_lead_won", context=context) def schedule_phonecall_send_note(self, cr, uid, ids, phonecall_id, action, context=None): phonecall = self.pool.get('crm.phonecall').browse(cr, uid, [phonecall_id], context=context)[0] @@ -883,7 +883,7 @@ class crm_lead(base_stage, format_address, osv.osv): def convert_opportunity_send_note(self, cr, uid, lead, context=None): message = _("Lead has been converted to an opportunity.") - lead.message_post(body=message) + lead.message_post(body=message, subtype="crm.mt_lead_convert_to_opportunity") return True def onchange_state(self, cr, uid, ids, state_id, context=None): diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index f734a839ff4..7fbdb7eec54 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -154,5 +154,24 @@ + + Convert to Opportunity + crm.lead + + + + Stage Changed + crm.lead + + + + Lost + crm.lead + + + + Won + crm.lead + From abe1c73f6341d1161e1a1673b8faef52e0c0bbfc Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 19 Nov 2012 17:12:46 +0530 Subject: [PATCH 4/8] [IMP] improve code bzr revid: fka@tinyerp.com-20121119114246-z5edddr6xphphbq0 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c1af024ad9c..d297534f1a2 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -679,7 +679,7 @@ class sale_order(osv.osv): def confirm_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, [obj.id], body=_("Quotation for %s converted to Sale Order of %s %s.") % (obj.partner_id.name, obj.amount_total, obj.pricelist_id.currency_id.symbol), context=context) + self.message_post(cr, uid, [obj.id], body=_("Quotation for %s converted to Sale Order of %s %s.") % (obj.partner_id.name, obj.amount_total, obj.pricelist_id.currency_id.symbol), subtype="sale.mt_order_confirmed", context=context) def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): From 742ad1b56e5701c941c0eaded89b4dbce517b145 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 19 Nov 2012 18:44:11 +0530 Subject: [PATCH 5/8] [IMP] add subtype in sales team bzr revid: fka@tinyerp.com-20121119131411-64g1l1mu9y0zrzij --- addons/crm/crm_lead_data.xml | 25 +++++++++++++++++++ addons/crm/crm_view.xml | 2 +- .../hr_timesheet_invoice.py | 4 +-- .../hr_timesheet_invoice_data.xml | 22 +++++++++++++++- addons/sale/sale_data.xml | 10 ++++++++ 5 files changed, 59 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index 7fbdb7eec54..8fc91ea8ea5 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -173,5 +173,30 @@ Won crm.lead + + + Leads Created + crm.case.section + + + + Leads to Opportunity + crm.case.section + + + + Leads Stage Changed + crm.case.section + + + + Opportunity Lost + crm.case.section + + + + Opportunity Won + crm.case.section + diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 99d3752529e..6fc40979fbb 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -131,7 +131,7 @@
- +
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index a24208d6ce0..679455e3864 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -107,13 +107,13 @@ class account_analytic_account(osv.osv): def set_open(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'open'}, context=context) message = _("Contract has been opened.") - self.message_post(cr, uid, ids, body=message, context=context) + self.message_post(cr, uid, ids, body=message, subtype="hr_timesheet_invoice.mt_account_renewed", context=context) return True def set_pending(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'pending'}, context=context) message = _("Contract has been set as pending.") - self.message_post(cr, uid, ids, body=message, context=context) + self.message_post(cr, uid, ids, body=message, subtype="hr_timesheet_invoice.mt_account_renew", context=context) return True account_analytic_account() diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml index e82b6fd19e8..410f59c6172 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml @@ -24,13 +24,33 @@ - finished + Contract Finished + account.analytic.account + + + Contract Renewed + account.analytic.account + + + Contract to Renew account.analytic.account canceled account.analytic.account + + Contract to Renew + crm.case.section + + + Contract Renewed + crm.case.section + + + Contract Finished + crm.case.section + diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index 89e1e7ed56c..b5a1ab4cd81 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -54,5 +54,15 @@ Sale Order Confirmed sale.order + + + Quotation sent + crm.case.section + + + + Sale Order Confirmed + crm.case.section + From b506f9689739791e0e080a271fb9a3a514adf8a2 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 20 Nov 2012 11:41:16 +0530 Subject: [PATCH 6/8] [IMP] improve code bzr revid: fka@tinyerp.com-20121120061116-gpkamw4o34wn4ful --- addons/crm/crm_lead_data.xml | 7 +++++++ .../hr_timesheet_invoice_data.xml | 11 +++++++---- addons/sale/sale_data.xml | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index 8fc91ea8ea5..e2f1c307bfb 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -157,16 +157,19 @@ Convert to Opportunity crm.lead + Stage Changed crm.lead + Lost crm.lead + @@ -177,21 +180,25 @@ Leads Created crm.case.section + Leads to Opportunity crm.case.section + Leads Stage Changed crm.case.section + Opportunity Lost crm.case.section + diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml index 410f59c6172..6d0a6797281 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml @@ -42,14 +42,17 @@ Contract to Renew crm.case.section - - - Contract Renewed - crm.case.section + Contract Finished crm.case.section + + + + Contract Renewed + crm.case.section + diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index b5a1ab4cd81..b93701baaf0 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -58,11 +58,13 @@ Quotation sent crm.case.section + Sale Order Confirmed crm.case.section + From a12d901e9c432aefa3f421600bf7c7830b59cce5 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 20 Nov 2012 17:35:03 +0530 Subject: [PATCH 7/8] [IMP] arrenge subtype bzr revid: fka@tinyerp.com-20121120120503-xl0wucde6ve7fnq3 --- addons/mail/static/src/js/mail_followers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 7bb019cde4f..fbcde0c83b3 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -193,11 +193,16 @@ openerp_mail_followers = function(session, mail) { /** Display subtypes: {'name': default, followed} */ display_subtypes:function (data) { var self = this; + var subtype = []; var subtype_list_ul = this.$('.oe_subtype_list'); var records = data[this.view.datarecord.id || this.view.dataset.ids[0]].message_subtype_data; _(records).each(function (record, record_name) { record.name = record_name; record.followed = record.followed || undefined; + subtype.push(record); + }) + subtype.sort(function(a,b){return a.id - b.id}); + _(subtype).each(function (record) { $(session.web.qweb.render('mail.followers.subtype', {'record': record})).appendTo( self.$('.oe_subtype_list') ); }); }, From b22ca1096c18f765d4970f8e41064cc1edfd4729 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 20 Nov 2012 18:04:48 +0530 Subject: [PATCH 8/8] [IMP] improve code bzr revid: fka@tinyerp.com-20121120123448-tke4jtzpwje1dlne --- .../hr_timesheet_invoice/hr_timesheet_invoice_data.xml | 10 +++++----- addons/sale/sale_data.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml index 6d0a6797281..fc083300fed 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml @@ -23,6 +23,10 @@ + + Contract to Renew + account.analytic.account + Contract Finished account.analytic.account @@ -31,12 +35,8 @@ Contract Renewed account.analytic.account - - Contract to Renew - account.analytic.account - - canceled + Canceled account.analytic.account diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index b93701baaf0..7d03e227e7f 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -55,7 +55,7 @@ sale.order - + Quotation sent crm.case.section