Features
- Odoo 19 support. (#70)
Features
- Use
odoo.modules.registry.Registry()instead of the now deprecated odoo.registry(). (#60)
Feature
- Add CI tests for Odoo 16 and Python 3.10. (#51)
Deprecations and Removals
- Drop support for python < 3.6 and Odoo 8, 9, 10. (#48)
Features
- Silenced a noisy warning about Environment.manage() being a no-op in Odoo 15. (#43)
Features
- Refined ImportError detection in
from click_odoo import odoo, for easier diagnostic of Odoo installation issues. (#36)
- Odoo 8 unconditionally registers wsgi handlers, which has the surprising
side effect to start a server in some circumstances, for instance when
calling
env["ir.module.module"].update_list()inclick-odoo-initdb. Disable them in click-odoo initialization, since they are useless and other Odoo version do not install them. - Support Odoo saas versions.
- revert change to logging made in 1.4.0
- add support for launching with
python -m click_odoo. Fixes #20. - apply
--log-levelto the root logger, so it works more intuitively by applying to the script too, and not only to theodoonamespace. This may change the log output of some scripts. In particular,--log-level=debugwill now apply debug logging to every python library used, and not only to Odoo. Fine tuning is available through thelog_handlerconfiguration item. - support Odoo config files with multiple comma separate databases names in db_name config entry.
- pass click ctx to environment_manager
- refactor
@click_odoo.env_optionsto allow propagatingenvto subcommands through the click context. Fixes #16. - do not log click Exit exception, which may be raised by subcommands as a result of --help.
Upgrading: - click-odoo now requires click>=7
- add
with_addons_pathoption to@click_odoo.env_optionsto control the presence of the--addons-pathoption. Defaults to False. Enabled for theclick-odooCLI.
- add
environment_managerto@click_odoo.env_options, providing a hook onodoo.api.Environmentcreation. - add
--addons-pathoption to the CLI. - add
database_must_existoption to@click_odoo.env_optionsso scripts can behave how they please in case the database is absent.
- silence deprecation warning
- adapt tests for Odoo 12
- clarify the behaviour of
@env_optionwith_databaseanddatabase_requiredparameters; in particular, whenwith_databaseanddatabase_requiredare both set (the default), the--databaseoption can be omitted as long as a database is declared in the Odoo configuration file.
- refactor the OdooEnvironment class: it is much cleaner when it leaves the global Odoo config alone, so we completely move responsibility to initialize the Odoo config to the CLI part.
- better error logging and handling: all exceptions occuring in scripts under click_odoo.env_options are logged and converted to ClickException so we are sure they are both in the log file and on the console (handled by click) for the user to see. The OdooEnvironment context manager does not do additional logging, leaving that responsibility to the caller.
- close db connections when releasing OdooEnvironment
- expose click_odoo.odoo_bin (odoo or openerp-server depending on Odoo series). not documented yet, because it should ideally be a full path corresponding to the installed click_odoo.odoo, and I'm not sure how best to detect it yet.
- minor documentation improvements
- add the possibility to run script without
--database(ie without env, but with a properly initialized Odoo library such as addons path) - be more resilient in case we can't obtain a context for the user
- click_odoo now exports the odoo namespace:
from click_odoo import odoois an alias forimport odoo(>9) orimport openerp as odoo(<=9) - add a
with_rollbackoption to theenv_optionsdecorator, to control the presence of the rollback option - document the
env_optionsdecorator
- commit in case of success, so users do not need to commit in their scripts, therefore making scripts easier to compose in larger transactions
- add a --rollback option
- interactive mode forces --rollback
- clear cache when starting environment (mostly useful for tests)
- simplify and test transaction and exception handling
- when leaving the env, log the exception to be sure it is visible
when using
--logfile
- improve transaction management: avoid some rare deadlock
- avoid masking original exception in case of error during rollback
- make sure scripts launched by click-odoo have
__name__ == '__main__' - add
--logfile option
- first alpha