summaryrefslogtreecommitdiff
path: root/odoo/modules/loading.py
AgeCommit message (Collapse)Author
2018-07-23[MERGE] forward port branch 9.0 up to af2e480e419Christophe Simonis
2018-07-05[MERGE] forward port branch 9.0 up to b5c50fa824aChristophe Simonis
2018-06-05[FIX] orm: re-create constraints of extended fieldsAdrian Torres
Before this commit: * Module A defines a field X of model M * Module B inherits from model M without touching field X * Module C inherits from model M and extends field X by giving an INDEX / NOT NULL constraint. * Module B and C depend from Module A, but not each other If all three modules are installed and Module B is updated, the INDEX / NOT NULL constraint could be dropped. This happens because Module B can be loaded before Module C is loaded, if that's the case, then after the upgrade of Module B, during the schema checking, we verify that the field object we have and the field on the DB are the same, since Module B doesn't introduce the index then this check is false and we drop the index. When we get to loading Module C, we do not do any schema checking because the module is not marked as `to upgrade`, therefore the index is lost forever. To solve this, we re-init the models that belong to the set of the intersection between upgraded and modified models and loaded and modified models. Fixes #24958
2017-12-01[FIX] *: Reset module states on registry init errorAdrian Torres
Commit 763d714 introduced cron job locking for databases which had modules with states set to 'to x', however if an installation/uninstallation/upgrade fails, the state will stay at 'to x', and it may stay in that state for an indefinite amount of time, meaning that cron jobs could stay locked forever. This commit fixes this in part by adding a cleanup function to loading.py that will be executed whenever load_modules fails, the function will change every 'to x' module to their original state, effectively unlocking the execution of cron jobs. This however only works to prevent "zombie" transient states for brand new databases, however for existing databases which already contain some modules in a zombie state it won't do anything unless a module is installed/uninstalled/upgraded, which may never happen. This is where the second part comes in (ir_cron.py), when failing to execute crons, we check if the failure was due to bad module state and if an arbitrary amount of time (5 hours as of this commit) has passed since the last time it was supposed to be executed, if it is the case, it means that the cron execution failed around 5 * 60 times (1 failure per minute for 5h) in which case we assume that the crons are stuck because the db has zombie states and we force a call to reset_module_states.
2017-01-06[MERGE] forward port branch saas-11 up to 9073ecb6f59Christophe Simonis
2017-01-04[FIX] core: leftover `openerp` use from last forward-portChristophe Simonis
2017-01-04[MERGE] forward port branch saas-11 up to 573293a06daChristophe Simonis
2016-09-02[FIX] odoo: rename imports and adapt import hooksRaphael Collet
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet