summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-06-18 13:22:23 +0000
committerXavier Morel <xmo@odoo.com>2020-07-27 06:32:59 +0000
commitef709fd92b7b22a58e60715c9ff7ab4476a83ca5 (patch)
tree6216bc42fe21c6b37c2ebf5cc0d66b4ccade2fc1 /addons/web/static/src/js/views/basic/basic_controller.js
parentdfda8b010ba8f20ea4fbc730eebd9c23d163c85a (diff)
[IMP] core, base: avoid multiple xids when importing records w/ inherits
Before this change, we create an xid for every parent of a record being imported, regardless of whether it already has an xid, or if it's being created implicitly through the child. This generates unnecessary extra xids on pre-existing objects e.g. update 5 product variants -> the product gets 5 new xids despite already having one. We should *only* set a xid on parent records which are being implicitly created by the creation of a child with a specified xid. That is, we should never set a xid on the parent if it exists before the child is created. Update _process_end to try and see if "non-loaded" xids correspond to an automatically generated "parent" xid: we're still setting a xid on implicitly created records (if the child is created with a xid) so they're properly removed if e.g. the module is uninstalled, but because we're only doing so at creation these xids will not be visited during update and _process_end will try to delete them. A special case can be added to check that "unknown" parent xids don't have children which _inherit them, in which case we want to protect them. Task 2251039 closes odoo/odoo#53283 Related: odoo/enterprise#12023 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions