Last active
April 20, 2016 19:13
-
-
Save leorochael/888f1a728b227676244c to your computer and use it in GitHub Desktop.
Using IPython with anybox.recipe.odoo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
parts = odoo | |
find-links = http://download.gna.org/pychart/ | |
[odoo] | |
version = git http://github.com/odoo/odoo.git odoo 8.0 depth=1 | |
recipe = anybox.recipe.odoo:server | |
eggs = | |
nose | |
ipython | |
bpython | |
openerp_scripts = | |
nosetests=nosetests command-line-options=-d | |
ipython command-line-options=-d arguments=user_ns=dict(session=session) | |
bpython command-line-options=-d arguments=locals_=dict(session=session) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
Session
object that is used inopenerp_scripts
expects that its switches be separated from the switches for the underlying script (i.e.nosetests
oripython
) by--
.This means that, in order to actually pass the
-d
switch for selecting the database, you need invoke, say,ipython_odoo
generated by the buildout above like:Otherwise the Session will try to open the database specified by
db_name
in<buildout:dir>/etc/odoo.cfg
(i.e. generated by theoptions.db_name
parameter toanybox.recipe.odoo:server
), defaulting to the database named after the current user.And IPython itself will complain that it doesn't know a
-d
switch.