Closed luisg123v closed 1 year ago
I think this should be moved to pylint-odoo, thoughts?
Yes, you are right.
Sounds good, thanks for the report, I will start looking into it
BTW, the commit where the lint was introduced sais:
another commit will introduce a pylint checker that will raise a warning any time that an unlink override raises an error.
So it would be worth it checking whether that was already implemented.
I looked around Odoo's commit history and found no reference to the checker, also installed a module that raises exceptions inside an unlink (and triggered them) and no warnings were found during installation or execution so I guess it was never implemented.
Starting from Odoo 15.0, the
unlink()
method should not raise any exception [1]. Instead, a method decorated with@api.ondelete
should be implemented, to prevent deletion constraints to be triggered when uninstalling modules.[1] https://github.com/odoo/odoo/commit/1c8a95809852baefa851985507a07ac7f6465dc7
CC @moylop260 @antonag32 @edy1192 @deivislaya