Berkan
Berkan

Reputation: 25

custom module installation error on odoo 14

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

Answers (2)

fudu
fudu

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

RAJNIK PATEL
RAJNIK PATEL

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

Related Questions