Skip to content

[16.0][FIX] shopfloor_reception: do not create a package level when putting in pack - #1311

Open
nicolas-delbovier-acsone wants to merge 2 commits into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception-link-to-package-level
Open

nicolas-delbovier-acsone wants to merge 2 commits into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception-link-to-package-level

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Oct 27, 2026 •

Copy link
Copy Markdown

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_id without assigning the stock.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_repack where _put_in_pack was missing an argument.

cc @jbaudoux

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @JuMiSanAr, @mmequignon,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:16.0 mod:shopfloor_reception Module shopfloor_reception labels Oct 27, 2026

@jbaudoux jbaudoux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you have a package level here?

@nicolas-delbovier-acsone nicolas-delbovier-acsone Oct 28, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 package

To 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

image

After the fix

image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I'll make the change 👍️

@nicolas-delbovier-acsone
nicolas-delbovier-acsone force-pushed the 16.0-fix-shopfloor_reception-link-to-package-level branch from ed362cf to 491f5ac Compare October 28, 2026 08:33
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [16.0][FIX] shopfloor_reception: link move line to existing package level on package select [16.0][FIX] shopfloor_reception: do not create a package level when putting in pack Oct 28, 2026
@OCA-git-bot OCA-git-bot added the mod:shopfloor_cluster_picking_repack Module shopfloor_cluster_picking_repack label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:shopfloor_cluster_picking_repack Module shopfloor_cluster_picking_repack mod:shopfloor_reception Module shopfloor_reception series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants