574
574
# no data for type 'back'
575
575
return wiz_obj.open_wizard(cr, uid, context['active_ids'], type='back', context=context)
577
def integrity_check_weight(self, cr, uid, ids, data, context=None):
579
integrity check on ppl2 data for weight
581
dict: {189L: {1: {1: {439: [{'asset_id': False, 'weight': False, 'product_id': 246, 'product_uom': 1,
582
'pack_type': False, 'length': False, 'to_pack': 1, 'height': False, 'from_pack': 1, 'prodlot_id': False,
583
'qty_per_pack': 1.0, 'product_qty': 1.0, 'width': False, 'move_id': 439}]}}}}
585
move_obj = self.pool.get('stock.move')
586
for picking_data in data.values():
587
for from_data in picking_data.values():
588
for to_data in from_data.values():
589
for move_data in to_data.values():
590
for data in move_data:
591
if not data.get('weight', False):
592
move = move_obj.browse(cr, uid, data.get('move_id'), context=context)
593
flow_type = move.picking_id.flow_type
594
if flow_type != 'quick':
599
577
def do_ppl2(self, cr, uid, ids, context=None):
610
588
picking_ids = context['active_ids']
611
589
# update data structure
612
590
self.update_data_from_partial(cr, uid, ids, context=context)
613
# integrity check on wizard data
614
partial_datas_ppl1 = context['partial_datas_ppl1']
615
if not self.integrity_check_weight(cr, uid, ids, partial_datas_ppl1, context=context):
616
raise osv.except_osv(_('Warning !'), _('You must specify a weight for each pack family!'))
617
591
# call stock_picking method which returns action call
618
592
return pick_obj.do_ppl2(cr, uid, picking_ids, context=context)