Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 22, 2025

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:

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

Footnotes

  1. see note on f583682

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.

Issue
-----
Pricelist is imported with 400 price rules.

Cause
-----
The back-end signals there's nothing left to import by having `nextrow`
be falsy[^1]. 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

[^1]: see note on f583682

X-original-commit: e940cb7
@robodoo
Copy link
Contributor

robodoo commented Jan 22, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 22, 2025

@lvsz @Iucapad this PR targets master and is the last of the forward-port chain.

To merge the full chain, use

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jan 22, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 22, 2025

@lvsz @Iucapad ci/runbot failed on this forward-port PR

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Jan 23, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 23, 2025

@lvsz @Iucapad this forward port of #188092 is awaiting action (not merged or closed).

@lvsz
Copy link
Contributor

lvsz commented Jan 23, 2025

@robodoo r+

robodoo pushed a commit that referenced this pull request Jan 23, 2025
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.

Issue
-----
Pricelist is imported with 400 price rules.

Cause
-----
The back-end signals there's nothing left to import by having `nextrow`
be falsy[^1]. 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

[^1]: see note on f583682

closes #194759

X-original-commit: e940cb7
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
@robodoo robodoo added the 18.2 label Jan 23, 2025
@robodoo robodoo closed this Jan 23, 2025
@fw-bot fw-bot deleted the master-17.0-opw-4164056-stop_importing_when_everything_has_been_imported-sile-wgDi-fw branch February 6, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
18.2 forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants