Skip to content

[17.0][18.0] stock_picking_group_by_partner_by_carrier: Problem due to the serialization of the super call in _create_backorder #2001

Closed as not planned

Description

@pedrobaeza

Steps to reproduce:

  • Install stock_picking_group_by_partner_by_carrier and stock_picking_batch.
  • Create 2 pickings.
  • Add both to the same batch.
  • Assign and put a partial done quantity.
  • Validate the batch picking and do backorders.

Result: The first picking is removed from the batch picking, while it shouldn't.

These steps can be seen in this test reproducing the scenario:

https://github.com/OCA/stock-logistics-workflow/actions/runs/15872247400/job/44751372455?pr=1997#step:8:732

Why is this happening? The module stock_picking_group_by_partner_by_carrier is serializing the super call of _create_backorder:

https://github.com/Tecnativa/stock-logistics-workflow/blob/63969b7ef7a9d3534c7e4a4c222a292b6882be3a/stock_picking_group_by_partner_by_carrier/models/stock_picking.py#L93

but the module stock_picking_batch is performing a condition reviewing if you are backordering the whole batch picking (the part any(p not in self for p in picking.batch_id.picking_ids - pickings_to_detach)):

https://github.com/odoo/odoo/blob/d83801027c9a88b6e4db8166b6e2aad41ed760b9/addons/stock_picking_batch/models/stock_picking.py#L178

as we are not passing to super the whole recordset, then each picking except the last are detached from the batch picking.

As I don't know the involved module, I can't suggest a solution for not having to serialize the super call. One I'm thinking on is to prepare a dictionary to pass by context with each picking d True/False as values for being checked in the other methods.

Please check @sebalix, as you were the one introducing the problem in b4bcddf

Other contributors: @jbaudoux @rousseldenis

Activity

  1. jbaudoux commented on Jun 26, 2025

    @jbaudoux
    Contributor

    From what I understand, we should face the same issue on any picking type, even the one that are not deliveries.

    Seems to be due to a recent change in odoo code
    https://github.com/odoo/odoo/blob/d83801027c9a88b6e4db8166b6e2aad41ed760b9/addons/stock_picking_batch/models/stock_picking.py#L178

  2. modified the milestones: 17.0, 18.0 on Jun 26, 2025
  3. changed the title [-][17.0] stock_picking_group_by_partner_by_carrier: Problem due to the serialization of the super call in `_create_backorder`[/-] [+][17.0][18.0] stock_picking_group_by_partner_by_carrier: Problem due to the serialization of the super call in `_create_backorder`[/+] on Jun 26, 2025
  4. pedrobaeza commented on Jun 26, 2025

    @pedrobaeza
    MemberAuthor

    Thanks, @jbaudoux my intention was to paste that second reference in my issue (I pasted the same twice). Corrected.

  5. jbaudoux commented on Jun 26, 2025

    @jbaudoux
    Contributor

    Shopfloor cluster picking doesn't seem to be affected by this bug https://github.com/OCA/wms/blob/16.0/shopfloor/services/cluster_picking.py#L1168
    The batch is not validated and backorders are anyway removed from the batch.

  6. pedrobaeza commented on Jul 1, 2025

    @pedrobaeza
    MemberAuthor

    @jbaudoux @sebalix any solution to this problem?

  7. pedrobaeza commented on Aug 23, 2025

    @pedrobaeza
    MemberAuthor

    @jbaudoux @sebalix please, this is blocking for #1997

  8. github-actions commented on Feb 22, 2026

    @github-actions

    There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
    If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

  9. added
    stale
    on Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions