'Checks if serial number is assigned to stock move or not and raise an error if it had to.'

@api.multi
def check_tracking(self, pack_operation):

    for move in self:
        if (move.picking_id and (move.picking_id.picking_type_id.use_existing_lots or move.picking_id.picking_type_id.use_create_lots) and (move.product_id.tracking != 'none') and (not (move.restrict_lot_id or (pack_operation and (pack_operation.product_id and pack_operation.pack_lot_ids)) or (pack_operation and (not pack_operation.product_id))))):
            raise UserError((_('You    need    to    provide    a    Lot/Serial    Number    for    product    %s') % ('%s    (%s)' % (move.product_id.name, move.picking_id.name))))
