From 080ea8d0dadaf148c0096925cf7ce8d1ef7d5e8b Mon Sep 17 00:00:00 2001 From: Andrius Preimantas Date: Wed, 27 May 2015 15:19:13 +0300 Subject: [PATCH] [FIX][account_credit_control] Do not link e-mails to Transient records Transient records are deleted periodically so res_id will point to ID which does not exists. And when reading email records system would also check if res_id can be read by user which would cause an exception because res_id might not exist at that point. --- .../wizard/credit_control_communication.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_credit_control/wizard/credit_control_communication.py b/account_credit_control/wizard/credit_control_communication.py index 5c9eca891..9efdc23bc 100644 --- a/account_credit_control/wizard/credit_control_communication.py +++ b/account_credit_control/wizard/credit_control_communication.py @@ -194,7 +194,10 @@ class CreditCommunication(models.TransientModel): comm.id, context=context) email_values['type'] = 'email' - + # model is Transient record (self) removed periodically so no point + # of storing res_id + email_values.pop('model', None) + email_values.pop('res_id', None) email = email_message_obj.create(email_values) state = 'sent'