Merge pull request #332 from odoo-dev/master-improve-scaffold-deploy-fme

Improve `odoo scaffold` and fix `odoo deploy`
This commit is contained in:
Fabien Meghazi 2014-06-04 01:00:59 +02:00
commit c91c5ec164
2 changed files with 7 additions and 5 deletions

View File

@ -74,17 +74,17 @@ class Deploy(Command):
parser.add_argument('--db', dest='db', help='Database to use if server does not use db-filter.')
parser.add_argument('--login', dest='login', default="admin", help='Login (default=admin)')
parser.add_argument('--password', dest='password', default="admin", help='Password (default=admin)')
parser.add_argument('--no-ssl-check', dest='no_ssl_check', action='store_true', help='Do not check ssl cert')
parser.add_argument('--verify-ssl', action='store_true', help='Verify SSL certificate')
if not cmdargs:
sys.exit(parser.print_help())
args = parser.parse_args(args=cmdargs)
if args.no_ssl_check:
if not args.verify_ssl:
self.session.verify = False
try:
if not args.url.startswith('http://'):
if not args.url.startswith(('http://', 'https://')):
args.url = 'https://%s' % args.url
result = self.deploy_module(args.path, args.url, args.login, args.password, args.db)
print(result)

View File

@ -89,6 +89,8 @@ class ScaffoldModule(object):
if self.created:
manifest_base = os.path.splitext(MANIFEST)[0]
self.render_file('%s.jinja2' % manifest_base, self.path('%s.py' % manifest_base))
# Create an empty __init__.py so the module can be imported
open(self.path('__init__.py'), 'a').close()
def add_model(self, model):
model_module = snake(model)
@ -131,8 +133,8 @@ class ScaffoldModule(object):
self.append_manifest_list('depends', 'website')
css_file = '%s_theme.css' % self.module
self.render_file('theme_css.jinja2', self.path('static', 'src', 'css', css_file))
theme_file = '%s_theme.xml' % self.module
self.append_xml_data('theme_xml.jinja2', self.path('views', theme_file), skip_if_exist=True)
self.append_xml_data('theme_xml.jinja2', self.path('views', 'templates.xml'), skip_if_exist=True)
self.append_manifest_list('data', 'views/templates.xml')
def has_import(self, initfile, module):
if not os.path.isfile(initfile):