Repository navigation
[16.0][FIX] shopfloor_reception: do not create a package level when putting in pack - #1311
nicolas-delbovier-acsone wants to merge 2 commits into
Conversation
|
Hi @JuMiSanAr, @mmequignon, |
jbaudoux
left a comment
There was a problem hiding this comment.
Something doesn't make sense to me here. I don't get how a package level can exist in a reception, as you need a source package
| }, | ||
| ) | ||
| self.assertTrue(line_1.result_package_id) | ||
| self.assertTrue(line_1.package_level_id) |
There was a problem hiding this comment.
How come you have a package level here?
There was a problem hiding this comment.
This comes from the default behavior of the _put_in_pack function from odoo that we are calling.
# In Shopfloor Reception
def process_with_new_pack(
self, picking_id, selected_line_id, quantity, is_over_reception_confirmed=False
):
picking = self.env["stock.picking"].browse(picking_id)
selected_line = self.env["stock.move.line"].browse(selected_line_id)
if response := self._process(
picking,
selected_line,
quantity,
callback=self.process_with_new_pack.__name__,
is_over_reception_confirmed=is_over_reception_confirmed,
):
return response
picking._put_in_pack(selected_line) # <- THIS LINE
return self._response_for_set_destination(picking, selected_line)
# in odoo core:
def _put_in_pack(self, move_line_ids, create_package_level=True):
...
if create_package_level:
package_level = self.env['stock.package_level'].create({
'package_id': package.id,
'picking_id': pick.id,
'location_id': False,
'location_dest_id': move_lines_to_pack.mapped('location_dest_id').id,
'move_line_ids': [(6, 0, move_lines_to_pack.ids)],
'company_id': pick.company_id.id,
})
return packageTo give you a little more insight on what I was trying to fix here is what I saw:
Procedure to reproduce
- One reception picking with one move for 10 product
- Partial receipt (2/10) with "new pack" button
- Partial receipt (2/8) with "existing pack" button
Before the fix
After the fix
There was a problem hiding this comment.
Would you say we should call _put_in_pack function with create_package_level=False so that there are no package level in the first place?
There was a problem hiding this comment.
Would you say we should call
_put_in_packfunction withcreate_package_level=Falseso that there are no package level in the first place?
I would go that way. Because it brings no benefit, it's even not convenient to revert. Because it's removed in newer versions. Because you can put goods from several IN on the same pack.
There was a problem hiding this comment.
OK I'll make the change 👍️
ed362cf to
491f5ac
Compare
When clicking on "process with new pack", a package level was created for the first line.
Then, when adding items to this existing destination package, new move lines were assigned
result_package_idwithout assigning thestock.package_level.This resulted in inconsistent views where only the initial line was included inside the
package level while subsequent lines remained outside.
After discussion with @jbaudoux (see below), it has been decided to remove the package level completely since it does not make sense in this scenario and this has even be removed in newer versions of odoo.
Note
Also contains a fix in
shopfloor_cluster_picking_repackwhere_put_in_packwas missing an argument.cc @jbaudoux