Merge lp:~camptocamp/oerpscenario/oerpscenario-odoo-8.0-erppeek-1.6b1 into lp:oerpscenario

Proposed by Yannick Vaucher @ Camptocamp
Status: Rejected
Rejected by: Yannick Vaucher @ Camptocamp
Proposed branch: lp:~camptocamp/oerpscenario/oerpscenario-odoo-8.0-erppeek-1.6b1
Merge into: lp:oerpscenario
Diff against target: 40 lines (+17/-4)
1 file modified
features/environment.py (+17/-4)
To merge this branch: bzr merge lp:~camptocamp/oerpscenario/oerpscenario-odoo-8.0-erppeek-1.6b1
Reviewer Review Type Date Requested Status
Camptocamp Pending
Review via email: mp+231886@code.launchpad.net

Description of the change

Adds compatibility with erppeek 1.6b1 and Odoo 8.0

This issue occured:

https://bugs.launchpad.net/oerpscenario/+bug/1360152

I'm not sure from where it comes but with erppeek 1.6b1 I was only able to use a string to have a working client.

This MP should wait on https://github.com/tinyerp/erppeek/pull/55

To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Unmerged revisions

333. By Yannick Vaucher @ Camptocamp

Add compatibility with erppeek 1.6b1 and Odoo 8.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'features/environment.py'
2--- features/environment.py 2013-09-03 10:44:42 +0000
3+++ features/environment.py 2014-08-22 13:09:03 +0000
4@@ -3,8 +3,10 @@
5 from support import tools, behave_better
6
7 __all__ = []
8-OPENERP_ARGS = '-c etc/openerp.cfg'
9-OPENERP_ARGS += ' --logfile var/log/behave-stdout.log'
10+OPENERP_ARGS = [
11+ '-c', 'etc/openerp.cfg',
12+ '--logfile=var/log/behave-stdout.log',
13+ ]
14
15 # Print readable 'Fault' errors
16 tools.patch_traceback()
17@@ -13,10 +15,21 @@
18
19
20 def before_all(ctx):
21- server = erppeek.start_openerp_services(OPENERP_ARGS)
22+ if erppeek.__version__ < '1.6b1':
23+ server = erppeek.start_openerp_services(' '.join(OPENERP_ARGS))
24+ else:
25+ server = erppeek.start_odoo_services(OPENERP_ARGS)
26 database = server.tools.config['db_name']
27 ctx._is_context = True
28- ctx.client = erppeek.Client(server, verbose=ctx.config.verbose)
29+ if erppeek.__version__ == '1.6b1':
30+ # FIXME for odoo 8.0rc1 with erppeek 1.6b1 to avoid:
31+ # 'AttributeError: environments'
32+ # we use serverurl instead of server module
33+ server_url = ('http://localhost:%s'
34+ % server.tools.config.options['xmlrpc_port'])
35+ ctx.client = erppeek.Client(server_url, verbose=ctx.config.verbose)
36+ else:
37+ ctx.client = erppeek.Client(server, verbose=ctx.config.verbose)
38 ctx.conf = {'server': server,
39 'admin_passwd': server.tools.config['admin_passwd'],
40 'db_name': database,

Subscribers

People subscribed via source and target branches

to all changes: