[FIX] sms: fix mock when sending sms

Only SMS not in error should be considered as sent instead of being
unlinked. This has no effect on current tests but will be used in
future cleaning.

Task-2634957
Prepares Task-2535005 (SMS view pimp) and Task-2560666 (IAP feedback)
PR odoo/odoo#75798
This commit is contained in:
Thibault Delavallée
2021-09-02 01:55:27 +00:00
parent feb510ae93
commit e86268222b
+1 -1
View File
@@ -65,7 +65,7 @@ class MockSMS(common.BaseCase):
return sms_unlink_origin(records, *args, **kwargs)
# hack: instead of unlink, update state to sent for tests
else:
records.filtered(lambda sms: sms.id in self._new_sms.ids).state = 'sent'
records.filtered(lambda sms: sms.id in self._new_sms.ids and sms.state != 'error').state = 'sent'
return True
try: