示例#1
0
def add_parser(subparsers):
    parser = subparsers.add_parser('initialize',
        description='Create and initialize a new OpenERP database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to create'))
    common.add_addons_argument(parser)
    parser.add_argument('-P', '--port', metavar='PORT',
        **common.required_or_default('PORT', 'the server port'))
    parser.add_argument('--module', metavar='MODULE', action='append',
        help='specify a module to install'
        ' (this option can be repeated)')
    parser.add_argument('--all-modules', action='store_true',
        help='install all visible modules (not compatible with --module)')
    parser.add_argument('--no-create', action='store_true',
        help='do not create the database, only initialize it')
    parser.add_argument('--exclude', metavar='MODULE', action='append',
        help='exclude a module from installation'
        ' (this option can be repeated)')
    parser.add_argument('--tests', action='store_true',
        help='run the tests as modules are installed'
        ' (use the `run-tests` command to choose specific'
        ' tests to run against an existing database).'
        ' Demo data are installed.')
    parser.add_argument('--coverage', action='store_true',
        help='report code coverage (particularly useful with --tests).'
        ' The report is generated in a coverage directory and you can'
        ' then point your browser to coverage/index.html.')

    parser.set_defaults(run=run)
示例#2
0
def add_parser(subparsers):
    parser = subparsers.add_parser('drop',
        description='Drop a database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to create'))

    parser.set_defaults(run=run)
示例#3
0
def add_parser(subparsers):
    parser = subparsers.add_parser('read', description='Display a record.')
    parser.add_argument('-d',
                        '--database',
                        metavar='DATABASE',
                        **common.required_or_default(
                            'DATABASE', 'the database to connect to'))
    common.add_addons_argument(parser)
    parser.add_argument('-m',
                        '--model',
                        metavar='MODEL',
                        required=True,
                        help='the model for which a record should be read')
    parser.add_argument('-i',
                        '--id',
                        metavar='RECORDID',
                        required=True,
                        help='the record id')
    parser.add_argument('-v',
                        '--verbose',
                        action='store_true',
                        help='display more information')
    parser.add_argument('--short',
                        action='store_true',
                        help='display less information')
    parser.add_argument(
        '-f',
        '--field',
        metavar='FIELD',
        help='display information only for this particular field')

    parser.set_defaults(run=run)
示例#4
0
def add_parser(subparsers):
    parser = subparsers.add_parser('initialize',
        description='Create and initialize a new OpenERP database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to create'))
    common.add_addons_argument(parser)
    parser.add_argument('--module', metavar='MODULE', action='append',
        help='specify a module to install'
        ' (this option can be repeated)')
    parser.add_argument('--all-modules', action='store_true',
        help='install all visible modules (not compatible with --module)')
    parser.add_argument('--no-create', action='store_true',
        help='do not create the database, only initialize it')
    parser.add_argument('--exclude', metavar='MODULE', action='append',
        help='exclude a module from installation'
        ' (this option can be repeated)')
    parser.add_argument('--tests', action='store_true',
        help='run the tests as modules are installed'
        ' (use the `run-tests` command to choose specific'
        ' tests to run against an existing database).'
        ' Demo data are installed.')
    parser.add_argument('--coverage', action='store_true',
        help='report code coverage (particularly useful with --tests).'
        ' The report is generated in a coverage directory and you can'
        ' then point your browser to coverage/index.html.')

    parser.set_defaults(run=run)
示例#5
0
def add_parser(subparsers):
    parser = subparsers.add_parser('drop',
        description='Drop a database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to create'))

    parser.set_defaults(run=run)
示例#6
0
def add_parser(subparsers):
    parser = subparsers.add_parser('uninstall',
        description='Uninstall some modules from an OpenERP database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to modify'))
    common.add_addons_argument(parser)
    parser.add_argument('--module', metavar='MODULE', action='append',
        help='specify a module to uninstall'
        ' (this option can be repeated)')

    parser.set_defaults(run=run)
示例#7
0
def add_parser(subparsers):
    parser = subparsers.add_parser('uninstall',
        description='Uninstall some modules from an OpenERP database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to modify'))
    common.add_addons_argument(parser)
    parser.add_argument('--module', metavar='MODULE', action='append',
        help='specify a module to uninstall'
        ' (this option can be repeated)')

    parser.set_defaults(run=run)
示例#8
0
def add_parser(subparsers):
    parser = subparsers.add_parser('initialize',
        description='Create and initialize a new OpenERP database.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to create'))
    common.add_addons_argument(parser)
    parser.add_argument('--module', metavar='MODULE', action='append',
        help='specify a module to install'
        ' (this option can be repeated)')
    parser.add_argument('--all-modules', action='store_true',
        help='install all visible modules (not compatible with --module)')
    parser.add_argument('--no-create', action='store_true',
        help='do not create the database, only initialize it')
    parser.add_argument('--exclude', metavar='MODULE', action='append',
        help='exclude a module from installation'
        ' (this option can be repeated)')

    parser.set_defaults(run=run)
示例#9
0
文件: read.py 项目: 0k/openerp-server
def add_parser(subparsers):
    parser = subparsers.add_parser('read',
        description='Display a record.')
    parser.add_argument('-d', '--database', metavar='DATABASE',
        **common.required_or_default('DATABASE', 'the database to connect to'))
    common.add_addons_argument(parser)
    parser.add_argument('-m', '--model', metavar='MODEL', required=True,
        help='the model for which a record should be read')
    parser.add_argument('-i', '--id', metavar='RECORDID', required=True,
        help='the record id')
    parser.add_argument('-v', '--verbose', action='store_true',
        help='display more information')
    parser.add_argument('--short', action='store_true',
        help='display less information')
    parser.add_argument('-f', '--field', metavar='FIELD',
        help='display information only for this particular field')

    parser.set_defaults(run=run)