diff options
| author | Adrian Torres <adt@odoo.com> | 2020-02-20 13:43:00 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-03-30 13:42:04 +0000 |
| commit | 1daf8eb12735db5c697e4a0868b43fe44f6b2f6a (patch) | |
| tree | b02820d3679615e7e92a6258a6cc1d428db4c526 /addons/website_slides_survey | |
| parent | f0481392c6501cae2c38359f526da1eefa451337 (diff) | |
[FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.
This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.
closes odoo/odoo#46325
Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/website_slides_survey')
| -rw-r--r-- | addons/website_slides_survey/models/slide_slide.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_slides_survey/models/slide_slide.py b/addons/website_slides_survey/models/slide_slide.py index 26b79394c58..76e1453eb7a 100644 --- a/addons/website_slides_survey/models/slide_slide.py +++ b/addons/website_slides_survey/models/slide_slide.py @@ -38,7 +38,9 @@ class SlidePartnerRelation(models.Model): class Slide(models.Model): _inherit = 'slide.slide' - slide_type = fields.Selection(selection_add=[('certification', 'Certification')]) + slide_type = fields.Selection(selection_add=[ + ('certification', 'Certification') + ], ondelete={'certification': 'set default'}) survey_id = fields.Many2one('survey.survey', 'Certification') nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True) |
