2 Generate an OpenERP module skeleton.
12 if os.path.exists(module):
13 print "The path `%s` already exists."
17 os.mkdir(os.path.join(module, 'models'))
18 with open(os.path.join(module, '__openerp__.py'), 'w') as h:
20 with open(os.path.join(module, '__init__.py'), 'w') as h:
22 with open(os.path.join(module, 'models', '__init__.py'), 'w') as h:
23 h.write(MODELS_PY % (module,))
25 def add_parser(subparsers):
26 parser = subparsers.add_parser('scaffold',
27 description='Generate an OpenERP module skeleton.')
28 parser.add_argument('module', metavar='MODULE',
29 help='the name of the generated module')
31 parser.set_defaults(run=run)
34 # -*- coding: utf-8 -*-
36 'name': '<Module name>',
38 'category': '<Category>',
43 'maintainer': '<maintainer>',
44 'website': 'http://<website>',
45 # Add any module that are necessary for this module to correctly work in
52 # Set to False if you want to prevent the module to be known by OpenERP
53 # (and thus appearing in the list of modules).
55 # Set to True if you want the module to be automatically whenever all its
56 # dependencies are installed.
57 'auto_install': False,
62 # -*- coding: utf-8 -*-
67 # -*- coding: utf-8 -*-
71 class my_model(openerp.osv.osv.Model):