summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-04-23 12:53:20 +0000
committerMartin Trigaux <mat@odoo.com>2019-06-11 12:04:08 +0000
commit8f88570ca18061716fd6e246b9d16aa2cbc24f3a (patch)
treec4903942817c08eb92a26b60600e878013de84a0 /addons/web/static/src/js/fields/basic_fields.js
parent2843dcfaa07ef98e0d44d33a24270a308a2b97ad (diff)
[FIX] base: proper removal of xmlid after update
Context: After a module update, the records present in ir_model_data table but not in self.pool.loaded_xmlids are considered as no longer needed and should be removed. An exception is done with noupdate=true entries. Bug 1: Entries with noupdate=NULL are not considered in the evaluation and are ignored while it may be worth deleting. Bug 2: Some records with their external id being automatically created are not present in self.pool.loaded_xmlids and may get removed after updating a module. By a lucky coincidence, bug 1 make it so that records targeted by bug 2 are ignored and not deleted (the "automagically" created ir.model.data often lack a noupdate value). Fix Bug 1: Use a COALESCE to find both records with noupdate=NULL and noupdate=false Fix Bug 2: Depends on the source of the generated external id: - ir.model: The entries created through _reflect_model were not loaded in self.loaded_xmlids Use the proper ORM method _update_xmlids that correctly populates self.pool.loaded_xmlids - ir.model.category: The categories were generated when the db was initalised, doing SQL was not avoidable. Create the categories in noupdate to avoid it being considered for removal. - ir.property: Are always created in noupdate in data files but in stock_account it was manually created without being in noupdate closes odoo/odoo#32881 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Co-authored-by: Raphael Collet <rco@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions