From c4a0b4f45a95479608e66d5c37dd76101dda4ef2 Mon Sep 17 00:00:00 2001 From: Gerard Dalmau Date: Tue, 16 Apr 2019 15:44:28 +0200 Subject: [PATCH] IMP create CRM with ID in name --- crm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crm.py b/crm.py index 3d9b520..4d07a13 100644 --- a/crm.py +++ b/crm.py @@ -97,12 +97,13 @@ def create(self, cursor, uid, vals, context=None): """Overwrite create method to create conversation if not in vals. """ res_id = super(CrmCase, self).create(cursor, uid, vals, context) - upd = {'name': vals['name']} + case_name = '[%s] %s' % (res_id, vals['name']) + upd = {'name': case_name} if 'conversation_id' not in vals: conv_obj = self.pool.get('poweremail.conversation') conv_id = conv_obj.create( cursor, uid, - {'name': '[%s] %s' % (res_id, vals['name'])} + {'name': case_name} ) upd['conversation_id'] = conv_id self.write(cursor, uid, [res_id], upd)