From 747f5d18c6deaf059f8085fd920f33dcad496a18 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 30 Apr 2012 16:23:49 +0530 Subject: [PATCH] [IMP] improved code for create_send_note bzr revid: tpa@tinyerp.com-20120430105349-2w5byy4dgsvgcaf9 --- addons/crm_claim/crm_claim.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 9673ba5e430..792cfbc3e9e 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -98,6 +98,17 @@ class crm_claim(crm.crm_case, osv.osv): def case_get_note_msg_prefix(self, cr, uid, id, context=None): return 'Claim' + def create(self, cr, uid, vals, context=None): + obj_id = super(crm_claim, 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 + def onchange_partner_id(self, cr, uid, ids, part, email=False): """This function returns value of partner address based on partner :param part: Partner's id