Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2710 Переглядів

I'm trying to add a new custom CLI argument, but don't seem to find a reasonable way to do that.

What I would like to achieve is to:

- Able to use a custom CLI argument ex. `--my-custom-arg` (I don't want to set this value from the odoo-server.conf file)
- The argument's value can be accessed like any other config value `from odoo.tools import config; config.get('my-custom-arg', False)` 
- Achieve this without the need to directly change core odoo code, I would like to do any monkey-patching or overriding from my own custom module.

I tried to monkey patch `odoo/tools/config.py configmanager()` class from my custom module but didn't succeed as custom modules are loaded after the configmanager already parses the CLI arguments (which makes total sense as odoo discovers custom modules from the `addons-path` argument)


Thank you!

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
4
лют. 25
829
0
груд. 18
3676
5
лют. 24
25640
1
жовт. 23
965
1
лип. 23
2032