summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-04-08 12:37:12 +0000
committerXavier Morel <xmo@odoo.com>2020-05-28 11:40:35 +0000
commit6b2dfcc8b0afc896c990413556ec18884c8c5801 (patch)
treecee53e26977b05888c9ce77dae34e802d62a2e47 /addons/web/static/src/js/views/basic/basic_renderer.js
parentff23dec4be1a17a7715bf1f89cece6472bd17bf5 (diff)
[IMP] core: batching during import
By default importing is batched (or at least attempted to), however because the import is functionally sequential it's possible for a record to refer to a previously imported record of the same batch. When records are referenced by xid this is easy, we can just keep track of all the xids we *should* have created so far and when trying to look up a xid if it's one of those flush all pending creations (otherwise assume it's some other unrelated xid which already exists in the system). For "name_search" lookups however this is more complicated, so we'd just flush the entire thing. This, then, is an issue when importing records with an m2o which is *generally* looked up by "name" rather than xid e.g. when importing partners it's more likely the "state" will be specified by name (e.g. AZ or Arizona) than xid (base.state_us_3 lol), because it means more or less every line will be flushed, defeating all batching and slowing down the import. To fix this, allow passing *model names* to flush (not just xids), and try to collate all the models we could be creating (or updating) records for in the process of importing. If we see a name_search on one of these models flush, otherwise don't because we couldn't have impacted the search. Task 1951307 While at it, f2a16187582ed697ffeea1522e4f0c745bf77016 removed all usage of model_load_save, but left the creation of the savepoint itself. The InternalError check should be left in place to catch things like conversion issues which put the tnx in an invalid state (only invalid states should trigger an InternalError according to psycopg's errors documentation). closes odoo/odoo#49289 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
0 files changed, 0 insertions, 0 deletions