Reputation: 25
ValueError: ir.actions.report.report_type: required selection fields must define an ondelete policy that implements the proper cleanup of the corresponding records upon module uninstallation. Please use one or more of the following policies: 'set default' (if the field has a default defined), 'cascade', or a single-argument callable where the argument is the recordset containing the specified option.
Upvotes: 2
Views: 1711
Reputation: 742
If you guys get this issue when database is cached, then try this (otherwise, ignore this solution):
Add dbfilter to odoo.conf:
dbfilter = ^your_db_name*
Then restart the server and go to /web/database/selector and select your db
Upvotes: 1
Reputation: 1049
You need to declare like this :
report_type = fields.Selection(
selection_add=[('sale', 'sale')],
ondelete={'sale': 'cascade'}
)
or you can also add this as per the requirement :
ondelete={'sale': 'set default'})
Upvotes: 2