← Back to team overview

openerp-community-reviewer team mailing list archive

[Bug 1269365] Re: Split Stock move breaks the destination moves logic logic

 

** Also affects: ocb-addons
   Importance: Undecided
       Status: New

** Also affects: ocb-addons/6.1
   Importance: Undecided
       Status: New

** Also affects: ocb-addons/7.0
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of OpenERP
Community Backports Team, which is subscribed to OpenERP Community
Backports (Addons).
https://bugs.launchpad.net/bugs/1269365

Title:
  Split Stock move breaks the destination moves logic logic

Status in OpenERP Community Backports (Addons):
  New
Status in OpenERP Community Backports (Addons) 6.1 series:
  New
Status in OpenERP Community Backports (Addons) 7.0 series:
  New
Status in OpenERP Addons (modules):
  Fix Committed

Bug description:
  How to reproduce the bug
  Context: have pull flow generating a 2 moves, linked together via move_dest_id field.
  Create a stock picking with one move (quantity =10)
  Split one stock move with new serial number
  In the stock picking now there are 2 SM with same product and same move_dest_id and complementary quantities (7+3)
  When processing the quantity in full, the second move in move_dest_id is still in waiting for another move

  It seems due to the following code in stock/stock.py (action_done
  around line 2400):

              if move.move_dest_id.id and (move.state != 'done'):
                  # Downstream move should only be triggered if this move is the last pending upstream move
                  other_upstream_move_ids = self.search(cr, uid, [('id','!=',move.id),('state','not in',['done','cancel']),
                                              ('move_dest_id','=',move.move_dest_id.id)], context=context)
                  if not other_upstream_move_ids:
                      self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})
                      if move.move_dest_id.state in ('waiting', 'confirmed'):
                          self.force_assign(cr, uid, [move.move_dest_id.id], context=context)
                          if move.move_dest_id.picking_id:
                              wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
                          if move.move_dest_id.auto_validate:
                              self.action_done(cr, uid, [move.move_dest_id.id], context=context)

  The first move will always find the second move as
  other_upstream_move_ids and the last one as well so condition "not
  other_upstream_move_ids" never happens (as the moves are sent as done
  later on, outside the for loop)

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