Sometimes, constraints are not delayed during a module upgrade: the module is 'to upgrade' but in 'init' mode :-/ Fix this by relying on the module's state only. closes odoo/odoo#45179 X-original-commit: 878b6538961a9b6a5fe1c6ac68d4ff39391abcdf Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>