← Back to team overview

openerp-india team mailing list archive

[Bug 1307523] [NEW] stock_picking.do_partial() returns wrong picking id when creating back order

 

Public bug reported:

Context: partially elaborate a stock.picking.out with only some lines available
In this case, stock_picking.do_partial() splits the picking by doing the following:
 - NEW PICKING: creates a new picking with only the available products, with the name of the original complete picking, set it as 'done';
 - ORIGINAL PICKING: changes the name  to the next sequence identifier, removes all the lines shipped in the new picking, set it as a backorder of the new picking

And this works correctly. The problem is in the return values:

1) It returns the original picking id as value for the 'delivered_picking' key, while the delivered picking is actually the new picking.
2) (related) it would be useful to return the original picking as 'back_order' so that it's easy to check if a new back_order has been created during the partial elaboration.

What it does at the moment is (conceptually) this:
res[pick.id] = {'delivered_picking': original_picking_id}
What it should do is this: (only in the case a new picking has been created, and the logic in the code to check this is already present at the end of the function)
res[pick.id] = {'delivered_picking': new_picking_id, 'back_order': original_picking_id}

So that, assuming 'result' is the return value of do_partial():
 - One has always the delivered picking id by calling `result[original_picking_id]['delivered_picking']`
 - One can check if a back order has been created by doing `if back_order in result[original_picking_id]`

If needed to better understand the problem, I can create a diff patch or
a merge proposal.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1307523

Title:
  stock_picking.do_partial() returns wrong picking id when creating back
  order

Status in OpenERP Addons (modules):
  New

Bug description:
  Context: partially elaborate a stock.picking.out with only some lines available
  In this case, stock_picking.do_partial() splits the picking by doing the following:
   - NEW PICKING: creates a new picking with only the available products, with the name of the original complete picking, set it as 'done';
   - ORIGINAL PICKING: changes the name  to the next sequence identifier, removes all the lines shipped in the new picking, set it as a backorder of the new picking

  And this works correctly. The problem is in the return values:

  1) It returns the original picking id as value for the 'delivered_picking' key, while the delivered picking is actually the new picking.
  2) (related) it would be useful to return the original picking as 'back_order' so that it's easy to check if a new back_order has been created during the partial elaboration.

  What it does at the moment is (conceptually) this:
  res[pick.id] = {'delivered_picking': original_picking_id}
  What it should do is this: (only in the case a new picking has been created, and the logic in the code to check this is already present at the end of the function)
  res[pick.id] = {'delivered_picking': new_picking_id, 'back_order': original_picking_id}

  So that, assuming 'result' is the return value of do_partial():
   - One has always the delivered picking id by calling `result[original_picking_id]['delivered_picking']`
   - One can check if a back order has been created by doing `if back_order in result[original_picking_id]`

  If needed to better understand the problem, I can create a diff patch
  or a merge proposal.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1307523/+subscriptions


Follow ups

References