Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def action_assign(self, cr, uid, ids, *args):
  2. """ Changes state of picking to available if all moves are confirmed.
  3. @return: True
  4. """
  5. for pick in self.browse(cr, uid, ids):
  6. move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed']
  7. if not move_ids:
  8. raise osv.except_osv(_('Warning !'),_('Not enough stock, unable to reserve the products.'))
  9. self.pool.get('stock.move').action_assign(cr, uid, move_ids)
  10. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement