-
-
Notifications
You must be signed in to change notification settings - Fork 209
[IMP] shopfloor: Add context key to control package total quantity computation #1063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.0
Are you sure you want to change the base?
Conversation
…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
3c0923d to
a6c8e87
Compare
jbaudoux
left a comment
There was a problem hiding this 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 ?
| ( | ||
| "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")), | ||
| ), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
|
This PR has the |
|
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. |
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