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)