[IMP] shopfloor: Add context key to control package total quantity computation#1063
[IMP] shopfloor: Add context key to control package total quantity computation#1063sbejaoui wants to merge 1 commit into
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.
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.
shouldn't the tuple be removed completely instead of returning a wrong value?
There was a problem hiding this comment.
@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