~fabien-morin/unifield-wm/testing

« back to all changes in this revision

Viewing changes to msf_outgoing/msf_outgoing.py

  • Committer: jf
  • Date: 2015-09-03 15:07:27 UTC
  • mfrom: (2611.3.2 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20150903150727-uce2z2krr9hw1sg0
US-557 [FIX] Fix issue during the double processing of an internal picking with Not available lines
lp:~unifield-team/unifield-wm/us-557

Show diffs side-by-side

added added

removed removed

Lines of Context:
3121
3121
                move = line.move_id
3122
3122
                first = False
3123
3123
 
 
3124
                if move.picking_id.id != picking.id:
 
3125
                    continue
 
3126
 
3124
3127
                if move.id not in move_data:
3125
3128
                    move_data.setdefault(move.id, {
3126
3129
                        'original_qty': move.product_qty,
3172
3175
                    move_obj.write(cr, uid, [move.id], values, context=context)
3173
3176
                    processed_moves.append(move.id)
3174
3177
 
 
3178
            if not len(move_data):
 
3179
                pick_type = 'Internal picking'
 
3180
                if picking.type == 'out':
 
3181
                    pick_type = 'Outgoing Delivery'
 
3182
 
 
3183
                raise osv.except_osv(
 
3184
                    _('Error'),
 
3185
                    _('An error occurs during the processing of the %(pick_type)s, maybe the %(pick_type)s has been already processed. Please check this and retry') % {'pick_type': pick_type},
 
3186
                )
 
3187
 
3175
3188
            # We check if all stock moves and all quantities are processed
3176
3189
            # If not, create a backorder
3177
3190
            need_new_picking = False
3180
3193
                   move_data[move.id]['original_qty'] != move_data[move.id]['processed_qty']):
3181
3194
                    need_new_picking = True
3182
3195
                    break
 
3196
 
3183
3197
            rw_full_process = context.get('rw_full_process', False)
3184
3198
            if rw_full_process:
3185
3199
                del context['rw_full_process']