-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
[14.0][IMP] shopfloor: zone picking handle complete mix package #621
[14.0][IMP] shopfloor: zone picking handle complete mix package #621
Conversation
324f2bf
to
6b69945
Compare
@mt-software-de thanks for your review. I updated the code for both of your comments. |
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.
The mobile version is not displaying correctly that a complete package is being moved. Only the desktop version is changed.
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.
I was not able to validate the move anymore. Odoo is complaining the package cannot be on 2 different locations
d605b53
to
0782202
Compare
I pretty sure I fixed that error after the rebase. |
0782202
to
010492b
Compare
shopfloor/services/zone_picking.py
Outdated
self._actions_for("packaging") | ||
data["handle_complete_mix_pack"] = ( | ||
self._handle_complete_mix_pack(move_line.package_id) | ||
and not self.work.menu.no_prefill_qty |
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.
This line seems to be redundant with what is in the _handle_complete_mix_pack
function
shopfloor/actions/packaging.py
Outdated
all the package quantities are reserved. | ||
""" | ||
return self.package_has_several_products(package) and all( | ||
[quant.quantity == quant.reserved_quantity for quant in package.quant_ids] |
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.
[quant.quantity == quant.reserved_quantity for quant in package.quant_ids] | |
quant.quantity == quant.reserved_quantity for quant in package.quant_ids |
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.
Also in change_package_lot.change_package
here https://github.com/OCA/wms/pull/621/files#diff-81fce66279454c4c0be2adf1f46eb4e629c63edfe409c4cf6bda95940686f9bcR676
it is lacking the new package in the ok func (response for set line destination) in case of complete mix pack
Btw, it is also lacking the qty_done there but not related to this PR
shopfloor/services/zone_picking.py
Outdated
if ( | ||
packaging.package_has_several_products(package) | ||
and not handle_complete_mix_pack | ||
): |
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.
With above suggestion, you can drop this change
try: | ||
stock.mark_move_line_as_picked(move_line, quantity, check_user=True) | ||
stock.mark_move_line_as_picked(move_lines, quantity, check_user=True) | ||
except ConcurentWorkOnTransfer as error: | ||
response = self._response_for_set_line_destination( |
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.
Because of line 938 where you set the quantity = None
we should not pass qty_done as argument.
Because we can not set qty_done to None, also it is not needed because it is already done.
kwargs = {}
if not package:
kwargs["qty_done"] = quantity
response = self._response_for_set_line_destination(
move_line,
message={
"message_type": "error",
"body": str(error),
},
**kwargs
)
return (location_changed, response)```
Last fixup updates all the previous comments |
fa254b4
to
5b8338b
Compare
This pr has been refactored a few times. And I could not find a reason for passing that package to So it is not needed and removed from previous implementation. |
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.
Tested
cfba907
to
5727e3f
Compare
I squashed the commits and rebased. |
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.
The move can be partially available
shopfloor/services/zone_picking.py
Outdated
quantity = None | ||
# Handling all move lines from a complete mix pack | ||
for _move_line in package.move_line_ids: | ||
if _move_line.state != "assigned": |
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.
if _move_line.state != "assigned": | |
if _move_line.state not in ("assigned", "partially_available"): |
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.
Fixed
@mt-software-de Can you update your review? |
( | ||
"quant_ids:total_quantity", | ||
lambda rec, fname: 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.
Due to the mass test, performance problems are gradually appearing. One performance problem is the data loading. Because of that, we should only load the data that is really needed, in the screen. With this change, total_quantity is always loaded for the package data, also in other scenarios where it is not needed.
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.
We could create a separate method, like _get_package_parser which is getting as argument the record to load and kwargs. And there we can add a kwarg like with_total_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.
can we do this improvement in another PR?
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.
yes we can do this.
I think we should create a PR which is doing it for all scenarios then.
@TDu can you squash the last fixup commit? |
3bb18b8
to
564cd6b
Compare
squashed and rebased. |
When a package has different product in it, it will be displayed with multiple move lines in the `select_line` step. And they will need to be move one after an other. For such package, this change allows to move such package in one step. In the selection of a line only one line for such package will be displayed. The quantity picker will not be displayed.
564cd6b
to
7962b3c
Compare
I had to fix a test after the rebase on |
/ocabot merge minor |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at f28b285. Thanks a lot for contributing to OCA. ❤️ |
When a package has different product in it, it will be displayed with multiple move lines in the
select_line
step. And they will need to be move one after an other.For such package, this change allows to move such package in one step.
ref.: rau-145