Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix create db odoo 8 #3

Merged
merged 2 commits into from Aug 29, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 13 additions & 8 deletions features/environment.py
Expand Up @@ -26,14 +26,6 @@ def _output_write(text):
'db_name': database,
'openerp_config': server.tools.config,
}
# We try to manage default login
# even if there is a sentence to log a given user
# Just add options.admin_login_password in your buildout to log from config
admin_login_password = server.tools.config.get('admin_login_password')
if admin_login_password:
ctx.client.login('admin', admin_login_password, database=database)
else:
ctx.client.login('admin', 'admin', database=database)


def before_feature(ctx, feature):
Expand All @@ -45,6 +37,19 @@ def before_scenario(ctx, scenario):
ctx.oe_context = {}
if not hasattr(ctx, 'data'):
ctx.data = {}
# do not login if tag `no_login` is present
# this allow to do database creation and sql requests
# before trying to login in Odoo
if not ctx.client.user and 'no_login' not in scenario.tags:
server = ctx.conf['server']
database = ctx.conf['db_name']
config = server.tools.config
# We try to manage default login
# even if there is a sentence to log a given user
# Just add options.admin_login_password in your buildout to log from
# config
admin_login_password = config.get('admin_login_password', 'admin')
ctx.client.login('admin', admin_login_password, database=database)


def before_step(ctx, step):
Expand Down