Skip to content

Conversation

@sbejaoui
Copy link

@sbejaoui sbejaoui commented Jun 24, 2025

the total quantity per package is not relevant or displayed in all scenarios where the parser is used. currently, it's only used in the zone_picking scenario

this PR introduces a context key to conditionally disable the total quantity computation based on the use case. this avoids unnecessary access to stock.quant when the information isn't required, improving performance and preventing potential concurrency issues

example of usage: e553521

@OCA-git-bot
Copy link
Contributor

Hi @guewen, @sebalix, @simahawk,
some modules you are maintaining are being modified, check this out!

@rousseldenis rousseldenis added enhancement New feature or request needs review labels Jun 24, 2025
@rousseldenis rousseldenis added this to the 16.0 milestone Jun 24, 2025
…mputation

the total quantity per package is not relevant or displayed in all scenarios where the parser is used.
currently, it's only used in the zone_picking scenario

this PR introduces a context key to conditionally disable the total quantity computation based on the use
case. this avoids unnecessary access to stock.quant when the information isn't required,
improving performance and preventing potential concurrency issues
@sbejaoui sbejaoui force-pushed the 16.0-shopfloor-package-no-quantity-sbj branch from 3c0923d to a6c8e87 Compare June 24, 2025 12:36
Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as it's only used when you handle_complete_mix_pack, can you by default not provide the data unless that option is enabled ?

cc @mt-software-de

Comment on lines 132 to 137
(
"quant_ids:total_quantity",
lambda rec, fname: sum(rec.quant_ids.mapped("quantity")),
lambda rec, fname: 0
if rec.env.context.get("no_quantity", False)
else sum(rec.quant_ids.mapped("quantity")),
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the tuple be removed completely instead of returning a wrong value?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbejaoui Indeed, it could be great as this could lead to wrong information. Could you check also if schema should not be adapted

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 9, 2025
@github-actions github-actions bot closed this Dec 14, 2025
@rousseldenis rousseldenis reopened this Jan 8, 2026
@OCA-git-bot
Copy link
Contributor

Hi @simahawk, @guewen, @sebalix,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved enhancement New feature or request needs review ready to merge stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants