odoo/odoo#194759

Created by fw-bot
Merged at 5b2733d01caf3abf69c7400c731eec37b59a57c5

Statuses:

label
odoo-dev:master-17.0-opw-4164056-stop_importing_when_everything_has_been_imported-sile-wgDi-fw
head
84fd6f04e029f36f3ee9d90ff46366ab6dd17e59
merged
9 months ago by Bugfix, Levi Siuzdak
odoo/odoo
17.0 #188092
saas-17.2 #193768
saas-17.4 #193817
18.0 #193992
saas-18.1 #194047
saas-18.2
saas-18.3
saas-18.4
19.0
master #194759

[FW][FIX] base_import: stop importing when everything has been imported

Versions

  • 17.0+

Steps

  1. Create a pricelist with 200 price rules;
  2. export pricelist to xlsx;
  3. delete original pricelist;
  4. import pricelist, setting batch size to 100.

Test files ready for import:
- 200_products.xlsx
- 200_pricelist_rules.xlsx

Issue

Pricelist is imported with 400 price rules.

Cause

The back-end signals there's nothing left to import by having nextrow be falsy1. The front-end ignores this, and continues looping until it's taken as many steps as it initially planned.

The upfront totalSteps calculation is too high when an imported record has a number of nested relational records that's larger than the batch size.

Solution

If the ORM returns a falsy nextrow value, call stopImport.

opw-4164056

Forward-Port-Of: #194047
Forward-Port-Of: #188092


  1. see note on f58368210c9c ↩