From 2c688759ac144cdbae6fa8e15b283d0e36285c0f Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 30 Apr 2012 16:38:41 +0530 Subject: [PATCH] [IMP] improved code for create send not and prefix bzr revid: tpa@tinyerp.com-20120430110841-kv2m6352bedtca6l --- addons/crm_fundraising/crm_fundraising.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/crm_fundraising/crm_fundraising.py b/addons/crm_fundraising/crm_fundraising.py index 76d0ca8fdd5..53217fea73e 100644 --- a/addons/crm_fundraising/crm_fundraising.py +++ b/addons/crm_fundraising/crm_fundraising.py @@ -108,6 +108,19 @@ class crm_fundraising(crm.crm_case, osv.osv): 'planned_revenue': 0.0, } + def case_get_note_msg_prefix(self, cr, uid, id, context=None): + return 'Fund' + + def create(self, cr, uid, vals, context=None): + obj_id = super(crm_fundraising, self).create(cr, uid, vals, context) + self.create_send_note(cr, uid, [obj_id], context=context) + return obj_id + + def create_send_note(self, cr, uid, ids, context=None): + for id in ids: + msg = '%s has been created.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) + self.message_append_note(cr, uid, [id], body=msg, context=context) + return True # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: