~credativ/openobject-addons/6.1-lp1238583_voucher_posting_entries_to_currency_income_accounts-

« back to all changes in this revision

Viewing changes to stock/stock.py

  • Committer: Craig Gowing (credativ)
  • Date: 2013-04-05 07:44:57 UTC
  • mfrom: (7029.1.170 addons-6.1-lp-1033731)
  • Revision ID: craig.gowing@credativ.co.uk-20130405074457-hyl12cv8804tpw50
[MERGE] Fix for lp-1033731

Show diffs side-by-side

added added

removed removed

Lines of Context:
727
727
 
728
728
        todo = self.action_explode(cr, uid, todo, context)
729
729
        if len(todo):
730
 
            self.pool.get('stock.move').action_confirm(cr, uid, todo, context=context)
 
730
            # JIT may assign stock moves immediately, so only confirm
 
731
            # moves if they are still draft
 
732
            move_obj = self.pool.get('stock.move')
 
733
            moves = move_obj.read(cr, uid, todo, ['id','state'], context=context)
 
734
            to_confirm = [ m['id'] for m in moves if m['state'] == 'draft' ]
 
735
            if len(to_confirm):
 
736
                self.pool.get('stock.move').action_confirm(cr, uid, to_confirm, context=context)
731
737
        return True
732
738
 
733
739
    def test_auto_picking(self, cr, uid, ids):