From aa9fa89423b341d1c95356065352bfc2d4a65d7d Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 29 Aug 2012 18:45:32 +0530 Subject: [PATCH] [IMP] improve demo data of crm and add demo data in project bzr revid: fka@tinyerp.com-20120829131532-vpvaaq0mbwdfktyk --- addons/crm/crm_lead_data.xml | 33 +++++++++++-------------- addons/mail/data/mail_data.xml | 11 +++++++++ addons/project/project.py | 16 ++++++------ addons/project/project_data.xml | 43 +++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 27 deletions(-) diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index ce9951defc6..6f6562657ce 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -155,37 +155,32 @@ - + new - + - + won - + - + lost - + - + stage change - + - - other - - + + - - email - + + - - comment - - + + diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index c8e8b1a488e..b241cb095de 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -12,5 +12,16 @@ + + + other + + + + email + + + comment + diff --git a/addons/project/project.py b/addons/project/project.py index 4a6311b7f56..4f23cbbdc49 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -536,23 +536,23 @@ def Project(): return project_id def create_send_note(self, cr, uid, ids, context=None): - return self.message_append_note(cr, uid, ids, body=_("Project has been created."), context=context) + return self.message_append_note(cr, uid, ids, body=_("Project has been created."), subtype="new", context=context) def set_open_send_note(self, cr, uid, ids, context=None): message = _("Project has been opened.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + return self.message_append_note(cr, uid, ids, body=message, subtype="open", context=context) def set_pending_send_note(self, cr, uid, ids, context=None): message = _("Project is now pending.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + return self.message_append_note(cr, uid, ids, body=message, subtype="pending", context=context) def set_cancel_send_note(self, cr, uid, ids, context=None): message = _("Project has been cancelled.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + return self.message_append_note(cr, uid, ids, body=message, subtype="cancel", context=context) def set_close_send_note(self, cr, uid, ids, context=None): message = _("Project has been closed.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + return self.message_append_note(cr, uid, ids, body=message, subtype="close", context=context) def write(self, cr, uid, ids, vals, context=None): # if alias_model has been changed, update alias_model_id accordingly @@ -1210,14 +1210,14 @@ class task(base_stage, 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('project.task.type').name_get(cr, uid, [stage_id], context=context)[0][1] - return self.message_append_note(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), context=context) + return self.message_append_note(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype="stage change", context=context) def create_send_note(self, cr, uid, ids, context=None): - return self.message_append_note(cr, uid, ids, body=_("Task has been created."), context=context) + return self.message_append_note(cr, uid, ids, body=_("Task has been created."), subtype="new", context=context) def case_draft_send_note(self, cr, uid, ids, context=None): msg = _('Task has been set as draft.') - return self.message_append_note(cr, uid, ids, body=msg, context=context) + return self.message_append_note(cr, uid, ids, body=msg, subtype="draft", context=context) def do_delegation_send_note(self, cr, uid, ids, context=None): for task in self.browse(cr, uid, ids, context=context): diff --git a/addons/project/project_data.xml b/addons/project/project_data.xml index c2d37f7943d..77eb203e66b 100644 --- a/addons/project/project_data.xml +++ b/addons/project/project_data.xml @@ -83,6 +83,49 @@ + + + + new + + + + + open + + + + pending + + + + + close + + + + cancel + + + + + stage change + + + + + draft + + + + + + + + + + +