summaryrefslogtreecommitdiff
path: root/addons/web/static/lib/jquery.mjs.nestedSortable
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2019-11-13 13:58:19 +0000
committerDenis Ledoux <dle@odoo.com>2019-11-13 13:58:19 +0000
commitc03e4cb229b2357e07159734153f2bbef8954822 (patch)
tree567ddfef004686d845c4106a50e35adfed19004c /addons/web/static/lib/jquery.mjs.nestedSortable
parent16891269ed5ae3ccc5d507a5d53cd607d0e942bc (diff)
[FIX] models: validate standard views set to noupdate in database
On the registry, the set `loaded_xmlids` maintains the list of the xml ids loaded during a module upgrade. (The <record/> nodes in XML data file) According to the `noupdate` attribute on the node in the XML file, an XML ID is added to the listn either: - If noupdate is set on the <data/> node, through `_load_xmlid`: - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L505-L510 - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1802 - If noupdate is not set on the <data/> node, through `_load_records` and `_update_xmlids`: - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L578 - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4048-L4050 - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1793 For this second case, `_update_xmlids` was called only when the condition `to_create or to_update` was met. For records not set as `noupdate="1" in the XML data file, but set to noupdate in the database (e.g. manually set by a user), the code goes trough the second path explained above (noupdate not set on the <data/> node) and the condition `to_create or to_update` was not met (See https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4005-L4012) and they were therefore not added in the set `loaded_xmlids` Besides, the method in charge to validate standard views `_validate_module_views`, only validates views that are in this list `loaded_xmlids`: https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_ui_view.py#L1194-L1210 And the method in charge to validate custom views `_validate_custom_views` only validates views with no XML ID or the module of the XML ID is not within the list of modules. Therefore, standard views set to noupdate in database were not validated at all (or indirectly, if they had a view inheriting on them that was not set to noupdate) This is not a recent regression, this is the case even in Odoo 8.0. Standard views set to `noupdate` in database but not in the XML files were not validated (or indirectly, through one of their inherited views if they had any) This revision just skips the test `to_create or to_update` so it goes through `_update_xmlids` anyway and add the xml id to the `loaded_xmlids` set, so standard views set to noupdate in database finally gets validated. Besides, `_update_xmlids` won't do anything more than add the xml id to the set, the SQL query executed in this method has a `WHERE` condition filtering out xml ids set to noupdate https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1784 closes odoo/odoo#40207 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Diffstat (limited to 'addons/web/static/lib/jquery.mjs.nestedSortable')
0 files changed, 0 insertions, 0 deletions