Commit Graph
10 Commits
Author SHA1 Message Date
Julien Castiaux 27865152bb [FIX] core: missing doc for some subcommands
Run `odoo-bin help`, you'll notice that some descriptions are missing,
this commit fixes that.

Run `odoo-bin shell --help`, you'll notice that the `usage:` line says
`odoo-bin [options]` instead of `odoo-bin shell [options]`. Other
commands that depend on the server cli are broken too. Fix those too.

closes odoo/odoo#121085

X-original-commit: 9c6bac741ff437564e7dbe4d0aa8dbd307b71f8d
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-06 11:44:58 +02:00
Xavier Morel cf221d4ba7 [ADD] cli: db manager
Currently dbs can only be managed via the UI in order to take
filestores in account: while it's possible to load/copy/rename/drop
databases via `psql`, that will not manage the related filestores so
the result of the operation is incomplete DBs and leftover filestores
littering the disk.

Seems like a good idea to add a CLI to perform the same
tasks. Currently the CLI calls into the corresponding service, rather
than both calling into (possibly better designed) unified APIs, but
that seems fine for an initial version.

The top-level `db` command acts as a db manager, with git-style
sub-sub-commands for the various operations:

- `load` to load a dump file into a database (with a specified name or
  not)
- `dump` to dump a local db to a zip dump (pg_dump can be created via
  the corresponding command so not a concern)
- `duplicate` and `rename`
- `drop` in order to drop both the database itself and the
  corresponding filestore

Notably, `create` is currently left out because a database can
trivially be created by invoking odoo using a dbname which doesn't
exist, so doesn't seem useful.

`list` is also left out, because `psql -l` generally does the job.

closes odoo/odoo#97365

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-26 18:41:26 +02:00
Julien Castiaux e9859a0979 [FIX] module.py: Remove useless path initialization
The `initialize_sys_path` is the function responsible of getting the
custom Odoo import hooks to work, i.e. addons import via
`import odoo.addons`. This function is called by some other module
related functions to ensure the paths are correctly setup. We are
confident it is useless to re-initialize the path in many places.

The `load_openerp_module` function is called during server bootup by
both `odoo-bin server` and `odoo-bin shell`, both command parse the
configuration before starting the server which initialize the paths
already.

Most call to `get_module`, `get_module_path` and `get_resource_path` are
done in models or controllers where a registry is setup already. There
is one notable exception which is the subcommand discovery done during
the bootup, for that specific case, we initialize the paths with a
partially loaded configuration.

closes odoo/odoo#49715

Task: 2200956
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-17 13:23:04 +00:00
Adrien Horgnies 745f5f951f [FIX] command: typo in unknown command exit message
closes odoo/odoo#39260

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-10-24 08:16:39 +00:00
xmo-odoo 6659d5a7d2 [FIX] P3: metaclasses handling
* cross-version metaclass spec
* more formally deprecate browse_record and browse_null since they
  were using metaclasses anyway
* update docstrings referencing the latter
2017-05-11 15:25:36 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo 6b9268bd15 [FIX] print statement -> function
In Python 3, ``print`` becomes a builtin function. This is available
in Python 2 by importing the ``print_function`` feature from
``__future__``, the feature is conveniently still available in Python
3 (it just does nothing).

Fixers:
    libfuturize.fixes.fix_print_with_import

#8530
2017-04-25 13:27:54 +02:00
Christophe Simonis 467a958ab0 [FIX] core: handle gevent on command line correctly 2016-09-30 12:05:49 +02:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00