-
- Downloads
[REF] registry: always perform registry/cache signaling at the end of request
Problem: the update of custom models/fields is not fully transactional, and may potentially lead to an inconsistent database. An other problem is creating two custom fields by writing on a model: if the second one fails, the first one has been committed without notice. Retrying the request will give an unexpected error (duplicate field name). Solution: never commit in the middle of a request. If the changes have an impact on the registry, then mark it as invalid (with a new flag), and signal registry invalidation after everything has been committed. If the request fails, reset the registry. Both registry and cache invalidation are handled the same way.
Showing
- addons/base_automation/models/base_automation.py 1 addition, 1 deletionaddons/base_automation/models/base_automation.py
- addons/mail/models/ir_model.py 0 additions, 1 deletionaddons/mail/models/ir_model.py
- odoo/addons/base/ir/ir_cron.py 2 additions, 1 deletionodoo/addons/base/ir/ir_cron.py
- odoo/addons/base/ir/ir_model.py 12 additions, 15 deletionsodoo/addons/base/ir/ir_model.py
- odoo/addons/base/res/res_font.py 1 addition, 1 deletionodoo/addons/base/res/res_font.py
- odoo/addons/base/tests/test_ir_actions.py 7 additions, 10 deletionsodoo/addons/base/tests/test_ir_actions.py
- odoo/http.py 3 additions, 1 deletionodoo/http.py
- odoo/models.py 1 addition, 5 deletionsodoo/models.py
- odoo/modules/loading.py 1 addition, 0 deletionsodoo/modules/loading.py
- odoo/modules/registry.py 51 additions, 22 deletionsodoo/modules/registry.py
- odoo/service/model.py 2 additions, 2 deletionsodoo/service/model.py
- odoo/service/report.py 2 additions, 2 deletionsodoo/service/report.py
- odoo/tests/common.py 1 addition, 0 deletionsodoo/tests/common.py
- odoo/tools/cache.py 1 addition, 3 deletionsodoo/tools/cache.py
- odoo/tools/sql.py 0 additions, 1 deletionodoo/tools/sql.py
Loading
Please register or sign in to comment