From ad07f50c3bde8faeb352ad473ec1400f083926b6 Mon Sep 17 00:00:00 2001 From: Paolo Gatti Date: Wed, 6 Nov 2024 11:51:45 +0100 Subject: [PATCH] [IMP] developer: added "--shell-file" CLI option Added the description for the new '--shell-file' option, which overrides the the $PYTHONSTARTUP env variable to initialize the shell session with a startup Python script. Related docs: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP Community PR: odoo/odoo#185075 task-4306704 --- content/developer/reference/cli.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/developer/reference/cli.rst b/content/developer/reference/cli.rst index 8150a4df61..f7a4e52eb5 100644 --- a/content/developer/reference/cli.rst +++ b/content/developer/reference/cli.rst @@ -695,9 +695,15 @@ interaction with the :ref:`orm ` and its functionalities. By default, the shell is running in transaction mode. This means that any change made to the database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`. + +.. option:: --shell-file + + Specify a Python script to be run after the start of the shell. Overrides the environment + variable `PYTHONSTARTUP`. + .. option:: --shell-interface (ipython|ptpython|bpython|python) - Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable + Specify a preferred `REPL` to use in shell mode. This shell is started with the `env` variable already initialized to be able to access the ORM and other Odoo modules. .. seealso::