← Back to team overview

openerp-india team mailing list archive

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

 

Public bug reported:

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)

** 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/1269365

Title:
  Split Stock move breaks the destination moves logic logic

Status in OpenERP Addons (modules):
  New

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/openobject-addons/+bug/1269365/+subscriptions


Follow ups

References