diff options
| author | Jason Van Malder <jvm@odoo.com> | 2020-01-23 13:33:42 +0000 |
|---|---|---|
| committer | Jason Van Malder <jvm@odoo.com> | 2020-01-27 09:06:19 +0000 |
| commit | ee8a30a19b8d94d923496e926a2f8e4277336e16 (patch) | |
| tree | 73fc337309ef078dd73cbc2e6c41a67292ec447e /addons/sms | |
| parent | f9e5f58b7d6f542442452b1e811066a446ede4b3 (diff) | |
[FIX] sms: fix context action not deleted when unlink template
Issue
- Install Calendar
- Technical > SMS templates > Calendar reminder > Add context action
- Calendar > Tree view > meeting > action is there
- Delete SMS template and/or uninstall calendar_sms
Template deleted but action still there with a traceback
when you click on it.
Cause
The action is never deleted.
Solution
Delete the action when the template is deleted.
OPW-2161653
Closes #42328
closes odoo/odoo#43984
X-original-commit: eb95f06f19c60babc775de57813a293ffc35c581
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Diffstat (limited to 'addons/sms')
| -rw-r--r-- | addons/sms/models/sms_template.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/sms/models/sms_template.py b/addons/sms/models/sms_template.py index f106c21139f..d09dd26a703 100644 --- a/addons/sms/models/sms_template.py +++ b/addons/sms/models/sms_template.py @@ -103,3 +103,7 @@ class SMSTemplate(models.Model): def _render_template(self, template_txt, model, res_ids): """ Render the jinja template """ return self.env['mail.template']._render_template(template_txt, model, res_ids) + + def unlink(self): + self.sudo().mapped('sidebar_action_id').unlink() + return super(SMSTemplate, self).unlink() |
