Developer’s notes¶
Source code¶
Source code and issue tracker on GitHub.
Continuous tests with Python 3.8 through 3.15 and PyPy.
Third-party integration¶
This module can be used with other Python libraries to achieve more complex tasks.
For example:
write unit tests using the standard unittest framework.
write BDD tests using the Gherkin language, and a library like Behave.
build an interface for Odoo, using a framework like Flask (HTML, JSON, SOAP, …).
Changes¶
2.6.5 (2026-04-12)¶
Use CSI x1b[ for colors, which is more universal than x9b.
Handle signal SIGWINCH to adjust width of output printing. Replace
colswithPrinter.widthto match output’s width.
2.6.4 (2026-03-26)¶
Remove
selffrom vars available in interactive mode. It was giving wrong suggestions in case of typing error.Inject
clearcommand in built-ins for Python <= 3.12.Adjust
call_kwpath to/web/dataset/call_kw/<model>/<methodfor adequate HTTP logging, and to be consistent with Odoo Web.
2.6.3 (2026-03-18)¶
Improve output coloring. Do not color Python keywords and built-ins.
2.6.2 (2026-03-17)¶
Fix command-line parsing.
2.6.1 (2026-03-17)¶
Fix invocation like
odooly https://demo.odoo.com.
2.6.0 (2026-03-17)¶
Colorize interactive console with Python 3.13+.
Switch to
argparsefor colored command line parser.Backport output coloring for Python <= 3.13. Use environment variable
FORCE_COLOR=1to enable it.Display error when identity check is not successful.
Add method
Env.sql()to execute SQL queries as an administrator.Drop support for Python 3.6 and 3.7.
Drop support for OpenERP and for Odoo 8.
Drop support for XML-RPC protocol. Use JSON-2 or JSON-RPC.
Remove
dbService. UseClient.databaseWebAPIinstead.Remove
reportService and workflow helpers. It was for Odoo <= 10.Remove option for CSV output.
Remove
%(...)formatting forRecordList.read(). Use{...}instead.
2.5.8 (2026-03-11)¶
Change
dir(...)ofRecordandRecordListto avoid extra API calls on readline completion.Json2: print details for internal server error 500.
Print API protocol on login: JSON-2, Web API, JSON-RPC, …
2.5.7 (2026-03-06)¶
Support Odoo saas-19.1. RPC service
Client.dbis removed.Fix
Envcaching when API switches to JSON-2.
2.5.6 (2026-02-26)¶
Fix error handling.
Fix module upgrade.
Fix
Envcaching when switching between databases.Clear API key when re-authenticating with password.
In case of
Client.connect()error, list known configurations.Optional argument
databaseforClient.connect().Improve performance of
Model.search()when a single record is retrieved.Preserve context for lazy
RecordListevaluation.
2.5.5 (2026-02-10)¶
Fix
Env.refresh()to preserve base methods.Hide password when
verboseis enabled.Improve error display.
2.5.4 (2026-02-09)¶
Fix XML-RPC methods.
2.5.3 (2026-02-09)¶
Odoo 19 and beyond: add documentation when using Web API or Json2 API. Stored on
Model._docattribute.Odoo 19 and beyond: list methods and arguments with
Model._methods()orRecordList._methods().Support HTTP Basic Authentication in URL, for example
odooly https://user:password@odoo.example.net/.Json2: internal refactoring, to detect
"ids"argument.Json2: fix arguments of
Record.copy().Support Python 3.15.
2.5.2 (2026-01-06)¶
Json2: performance improvement. Parameters of standard public methods are predefined.
Json2: improve error handling, catch HTTP status 401, 403 and 404.
Json2: set
Accept: application/jsonHTTP header.Fix login with
__system__user. Note: it is not supported, and disabled during Odoo installation, for safety reason. UseEnv.sudo()orModel.sudo()instead.
2.5.1 (2025-11-11)¶
Fix Json2 API.
2.5.0 (2025-11-11)¶
Simplify signature of
Model.search(): argumentsorder,limitandoffsetbecome keyword-only, and undocumented argumentreverseis abandoned.New:
Model.search()returns aRecordListwhich is lazily evaluated. API method is called only when needed: if attributes are read or methods are called. It will use search_read API method when it’s adequate.New: extracting a part of a lazy
RecordListwill not call API method, for simple use cases likeenv['account.move'].search([])[10:90]. It will setoffsetandlimiton the prepared search instead.Remove undocumented
Env._web().Refactor code for
readfield formatter.Refactor
RecordandRecordListconstructors: get rid of__new__and simplify.Add private method
Record._invalidate_cache()to implementRecord.refresh().Property
Client.verboseto enable/disable logging.Support
odooly https://demo.odoo.comfor simplicity.
2.4.7 (2025-11-07)¶
Interactive: add possibility to change verbosity. E.g.:
client._printer.cols = 180. Set to0to disable.Retrieve models when user does not have access to
ir.model. Only for Odoo 15 there’s no workaround. For Odoo >= 16 a methodget_available_modelsis available to all users.Do not list
transientmodels withEnv.models().Enhance error management for JSON-2 API with Odoo >= 19.
Improve type-checking for
writemethods.Handle
fields.Serializedfields without error.
2.4.6 (2025-10-31)¶
For WebAPI and JSON-RPC, do not print traceback for common Odoo errors, like
UserErrorandValidationError.Fix
sudo()KeyError in some cases.Do not raise an error when a field is read on a ghost
Record.Fix HTTP session error when switching to a different database.
2.4.5 (2025-10-30)¶
Configure
server = ...instead ofscheme / host / port / protocol.Better error message for
inoperator onRecordList.Use
display_nameinstead ofname_get()for Odoo >= 8, becausename_getis deprecated in Odoo 17 and removed in Odoo 18.Remove workaround not needed anymore for interactive console. Issue was fixed in Python source code.
2.4.4 (2025-10-16)¶
Support
{...}string format forRecordList.read()andModel.read().Use
search_readmethod with Odoo >= 8.Fix cache when switching between environments.
Use a separate HTTP session when using JSON-2 API Key.
Change
Model.sudo()andRecordList.sudo()to become Superuser, on Odoo >= 12.Fix ResourceWarning with Python 3.14.
2.4.3 (2025-10-12)¶
Add operators
not =likeandnot =ilikefor Odoo 19.Fix API Key authentication for RPC protocols.
Able to connect with HTTP redirection. For example:
odooly --server http://demo.odoo.comAdd method
Client.save()to save current environment in memory, with a name. ChangeClient.get_config()to a class method.Fix command line usage with a list of IDs.
Keep
env.user.loginwhenenv.user.refresh()is called.Obfuscate
Env.contextin cache key.
2.4.2 (2025-10-08)¶
New method
Env.set_api_key().
2.4.1 (2025-10-06)¶
Catch and format authentication error properly.
Print errors when
verboseis enabled.Fix 2FA authentication retry, when code is invalid.
Fix incorrect data serialization when JSON is empty
{}.Try to login even if
databaseis not set, with Odoo >= 10.Fix Web authentication for Odoo 10 to 14.
Ask for confirmation before (un)installing dependent modules.
Propose database selector when needed, even for JSON-2 authentication.
Support
--api-keyon the command line.
2.4.0 (2025-10-03)¶
Store
Env.session_infowhen it is retrieved with Webclient API. Insertuser_contextintosession_infowhen RPC API is used.Add a database selector for Webclient API.
Method
existsbecomes private with Odoo 19.Fix method
Env.upgrade_cancel()for Odoo 19.Fix parsing version of Saas instances.
New static method
Client.get_config()Support JSON-2 API with Odoo >= 19.
Configure
api_keyseparately. Allow to use JSON-2 even ifpasswordis not configured.New method
Env.generate_api_key()for Odoo >= 14.Support methods protected by
check_identity, for Odoo >= 14.
2.3.2 (2025-10-01)¶
Print HTTP error status when error occurs.
Support
env._web.session('get_session_info')as alternative toclient.web_session.get_session_info(), for example.When using Webclient,
database =configuration becomes optional.Method
Model.sudo()defaults to'admin'user, instead of UID 1.Simplify authentication, passwords are encrypted since Odoo 12 and values cannot be retrieved by
'admin'.Add API overview table to the documentation: availability and authentication mode per Odoo version.
2.3.1 (2025-09-30)¶
Fix
context_getarguments.Do not authenticate with
/web/session/authenticatewhen protocol isjsonrpcorxmlrpc. It cannot authenticate API keys.Experimental support for 2FA with Webclient session, with Odoo >= 15.
Fix PyPI classifiers.
Update documentation.
2.3.0 (2025-09-29)¶
Support webclient
WebAPIprotocol as an alternative:/web/dataset/*,/web/database/*, … Webclient API is stable since Odoo 9.Authenticate with
/web/session/authenticateby default and retrieveEnv.session_info, with Odoo >= 9.Use Webclient API by default when
protocolis not set. It is same as settingprotocol = web.New function
Client.drop_database().New functions to create/destroy a session:
Env.session_authenticate()andEnv.session_destroy().Drop support for Python 3.5.
2.2.1 (2025-09-24)¶
Support method
Model.create()with a list of values. With Odoo >= 12.Support method
RecordList.copy(). With Odoo >= 18.Extend local mode to support Odoo >= 15.
Fix
Env.uninstall().Add helper
Env.upgrade_cancel()to reset module states.
2.2.0 (2025-09-16)¶
Support for Odoo 17, 18 and 19.
Support Python 3.12 and 3.13.
Drop support for Python 2.7 and Python 3.4.
Enable Github Actions CI. Remove Travis CI.
Support new search operators: any|not any|parent_of.
2.1.9 (2019-10-02)¶
No change. Re-upload to PyPI.
2.1.8 (2019-10-02)¶
Default location for the configuration file is the initial working directory.
Enhanced syntax for method
RecordList.filtered(). E.g. instead ofrecords.filtered(lambda r: r.type == 'active')it’s faster to userecords.filtered(['type = active']).Support unary operators even for Python 3.
Basic sequence operations on
Envinstance.
2.1.7 (2019-03-20)¶
No change. Re-upload to PyPI.
2.1.6 (2019-03-20)¶
Fix
RecordList.mapped()method with empty one2many or many2many fields.Hide arguments of
partialobjects.
2.1.5 (2019-02-12)¶
Fix new feature of 2.1.4.
2.1.4 (2019-02-12)¶
Support
env['res.partner'].browse()and return an emptyRecordList.
2.1.3 (2019-01-09)¶
Fix a bug where method
with_contextreturns an error if we update the values of the logged-in user before.Allow to call RPC method
env['ir.default'].get(...)thanks to a passthrough in theModel.get()method.
2.1.2 (2019-01-02)¶
2.1.1 (2019-01-02)¶
Do not call ORM method
existson an empty list because it fails with OpenERP.Provide cursor
Env.crin local mode, even with OpenERP instances.Optimize and fix method
RecordList.filtered().
2.1 (2018-12-27)¶
Allow to bypass SSL verification if the server is misconfigured. Environment variable
ODOOLY_SSL_UNVERIFIED=1is detected.Accept multiple command line arguments for local mode. Example:
odooly -- --config path/to/odoo.conf --data-dir ./varAdd
selfto theglobals()in interactive mode, to mimic Odoo shell.On login, assign the context of the user:
env['res.users'].context_get(). Do not copy the context when switching database, or when connecting with a different user.Drop attribute
Client.context. It is only available asEnv.context.Fix hashing error when
Env.contextcontains a list.Assign the model name to
Record._name.Fix installation/upgrade with an empty list.
Catch error when database does not exist on login.
Format other Odoo errors like
DatabaseExists.
2.0 (2018-12-12)¶
Fix cache of first
Envin interactive mode.Correctly invalidate the cache after installing/upgrading add-ons.
Add tests for
Model.with_context(),Model.sudo()andEnv.sudo().Copy the context when switching database.
Change interactive prompt
sys.ps2to" ... ".
2.0b3 (2018-12-10)¶
Provide
Env.sudo()in addition to same method onModel,RecordListandRecordinstances.Workflows and method
object.exec_workfloware removed in Odoo 11.Do not prevent login if access to
Client.db.list()is denied.Use a cache of
Envinstances.
2.0b2 (2018-12-05)¶
Add documentation for methods
RecordList.exists()andRecordList.ensure_one().Add documentation for methods
RecordList.mapped(),RecordList.filtered()andRecordList.sorted().Add documentation for methods
Model.with_env(),Model.sudo()andModel.with_context(). These methods are also available onRecordListandRecord.Changed method
existsonRecordListandRecordto return record(s) instead of ids.Fix methods
mapped,filteredandsorted. Add tests.Fix method
RecordList.ensure_one()when there’s identical ids orFalsevalues.Fix method
RecordList.union(...)and related boolean operations.
2.0b1 (2018-12-04)¶
First release of Odooly, which mimics the new Odoo 8.0 API.
Other features are copied from ERPpeek 1.7.