From 71ab12840bc787ca486202255cd6faa21281b9e1 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 14 Jul 2020 14:29:10 +0000 Subject: [IMP] *: do not specify unwanted defaults in default_get When default_get is called, the wanted fields are specified through the fields_list arg. It is useless to fill the values for unwanted fields. As default_get is called for nearly all records creation, simplifying the default_get overrides: * remove potential wrong side-effects of the values * remove some useless or wrong defaults computations (searches, refs, ...) --- addons/sms/wizard/sms_resend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/sms') diff --git a/addons/sms/wizard/sms_resend.py b/addons/sms/wizard/sms_resend.py index f8b5c956977..24d59c1a5ea 100644 --- a/addons/sms/wizard/sms_resend.py +++ b/addons/sms/wizard/sms_resend.py @@ -27,7 +27,7 @@ class SMSResend(models.TransientModel): @api.model def default_get(self, fields): result = super(SMSResend, self).default_get(fields) - if result.get('mail_message_id'): + if 'recipient_ids' in fields and result.get('mail_message_id'): mail_message_id = self.env['mail.message'].browse(result['mail_message_id']) result['recipient_ids'] = [(0, 0, { 'notification_id': notif.id, -- cgit v1.2.3