-
-
Notifications
You must be signed in to change notification settings - Fork 199
[FIX][14.0] shopfloor cluster_picking: fix line split #986
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: 14.0
Are you sure you want to change the base?
Conversation
f511a2e
to
21f31bf
Compare
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.
LG
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.
LGTM
|
||
# Keeping second return value for compatibility | ||
# Quantity already checked at _check_line_qty_processible | ||
new_line, __ = move_line._split_qty_to_be_done(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.
Could you also extend test_scan_destination_pack_bin_not_found
and ensure that there is also no new stock.move.line created.
Because by moving _split_qty_to_be_done
you fixed also the problem, that there is a stock.move.line created, when a wrong barcode is scanned and you entered a lower qty as product_uom_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.
ping @mmequignon
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 sorry, forgot to answer, I'll do this ASAP
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.
@mmequignon could you extend the test?
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.
@mt-software-de I tried to reproduce this behavior with 14.0, no new move line is created after scan_destination_pack
is called.
all_lines = self.env["stock.move.line"].search([])
line = self.one_line_picking.move_line_ids
response = self.service.dispatch(
"scan_destination_pack",
params={
"picking_batch_id": self.batch.id,
"move_line_id": line.id,
# this bin is used for the other picking
"barcode": "⌿",
"quantity": line.product_uom_qty,
},
)
new_lines = self.env["stock.move.line"].search([("id", "not in", all_lines.ids)])
self.assertFalse(new_lines)
What am I missing here?
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 quantity should be less than line.product_uom_qty
. Only then the split is called.
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.
@mmequignon Can you check that ?
def _set_destination_update_quantity__fallback( | ||
self, move_line, empty_rec, quantity | ||
): | ||
return None |
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.
Should it not also return a response ?
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.
No, response was initially set to None, and if no product or lot were found from barcode, None would be returned.
This is the trick used to do multiple things from a single shopfloor screen (increase quantities and set destination package).
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.
LG
At
scan_destination_pack
when a destination package is scanned without any qty processed (especially when no prefill quantity is enabled), we would end up with a new move line with qty = 0.Instead, return an error to the user.