Repository navigation
[16.0][FIX] shopfloor: handle multiple move lines in location content transfer - #1303
Conversation
|
Hi @jbaudoux, @mmequignon, @TDu, @sebalix, @simahawk, |
9f4f1d8 to
5484fd7
Compare
jbaudoux
left a comment
There was a problem hiding this comment.
Your fix for the 2 move lines cases looks good.
However, for the partial quantity, there is another call missing to split the move line.
| # ↓ Necessary in case of partial because `qty_done = move_line.reserved_uom_qty` | ||
| # since we made a "mark_move_line_as_picked" | ||
| move_line.qty_done = quantity |
There was a problem hiding this comment.
If you decrease the quantity, we need to split the move line for the processed quantity.
There was a problem hiding this comment.
I did the test, I think the splitting is working as expected. Have a look:
Setup:
- A picking (
WH/LCT/00008) with one move for 10 qty and 2 move lines (each for 5 qty) - In shopfloor, click on "Process by line" to process first line of the picking
- Only process 3/5 qty of the move line
This comes from this code inside set_destination_line:
# create the split order (WH/LCT/00009)
move_line._extract_in_split_order()
# create the backorder (WH/LCT/00010)
backorders = stock.validate_moves(move_line.move_id)There was a problem hiding this comment.
That's my point. If there is 5 to do and you do 2, a split order LCT/00010 must be created for the processed 2, and the remaining 3 should still be there to process in the initial LCT/00009.
Here, the code thinks everything was done (because you processed the last move line) and launches the backorder procedure at validation. But this is wrong because if you split the move line for the processed quantity, it will detect that not everything is done and do this extract in split order.
There was a problem hiding this comment.
I see you replaced it by a call to mark_move_line_as_picked. Can you add a test for this with a line partially processed?
6a70748 to
54b3138
Compare
| def shopfloor_postpone(self, *recordsets): | ||
| """ | ||
| Specific behavior for move lines. | ||
| As we need to reset qty_done. | ||
|
|
||
| """ | ||
| res = super().shopfloor_postpone(*recordsets) | ||
| self.qty_done = 0.0 | ||
| return res |
There was a problem hiding this comment.
This was likely for the cluster picking. You should probably add it there after the call to this method.
Co-authored-by: Jacques-Etienne Baudoux <je@bcim.be>
…rtial transfers Mixing split orders and backorders made transfer tracking overly complex and hard to follow. Partial transfers now rely exclusively on split orders to extract validated quantities from the original picking.
54b3138 to
8ef69cc
Compare
|
@jbaudoux The last implementation gets rid of backorders to only rely on split orders. Here is a screenshot to show what happens when we process:
Is that what you had in mind? Note that code on the backorder policy: I adapted the code to make tests pass but... Do we need to keep this? I am not sure since we do not rely on "backorders" anymore. WDYT? |
Fix premature auto-validation of sibling move lines in
location_content_transferProblem
When processing transfers via the Location Content Transfer service in "process by line" mode (
go_to_single), validating a singlestock.move.lineinvokesstock.validate_moves(move_line.move_id)without splitting the done move line from the (potential) others first.If a single
stock.movecontained multiplestock.move.linerecords (such as when demand is satisfied across multiple lots), validating the parentmove_idcaused Odoo to validate all related move lines at once. As a result, completing the first scanned line automatically completed remaining sibling lines without requiring the operator to scan them in Shopfloor.Notes
qty_doneto0. Because_find_transfer_move_linesfilters out lines withqty_done <= 0, postponed lines were subsequently ignored instead of being proposed back to the operator.test_postpone_line_ok_with_two_lines_and_view(also introduced in [16.0][FIX] shopfloor: Don't embed postponed line quantity #911): that test was testing something impossible to do from UI. You can not create an LOC picking for 2 move lines in 2 different sub-locations. If you create such a picking by hand, scanning the parent location through UI would split one move line into a split order and thus only present you one of them to process.