Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 15, 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: #188092

Footnotes

  1. see note on f583682

@robodoo
Copy link
Contributor

robodoo commented Jan 15, 2025

Pull request status dashboard

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

fw-bot commented Jan 15, 2025

This PR targets saas-17.4 and is part of the forward-port chain. Further PRs will be created up to master.

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

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

fw-bot commented Jan 15, 2025

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

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: ef845ff
@lvsz lvsz force-pushed the saas-17.4-17.0-opw-4164056-stop_importing_when_everything_has_been_imported-sile-03nZ-fw branch from bd915b7 to 4cd71bf Compare January 16, 2025 11:33
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 16, 2025

@lvsz @Iucapad this PR was modified / updated and has become a normal PR. It must be merged directly.

@lvsz
Copy link
Contributor

lvsz commented Jan 16, 2025

robodoo r+

@C3POdoo C3POdoo requested review from a team, Gorash and xmo-odoo and removed request for a team January 16, 2025 11:36
robodoo pushed a commit that referenced this pull request Jan 16, 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 #193817

X-original-commit: ef845ff
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
@robodoo robodoo closed this Jan 16, 2025
@fw-bot fw-bot deleted the saas-17.4-17.0-opw-4164056-stop_importing_when_everything_has_been_imported-sile-03nZ-fw branch January 30, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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