Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

click-odoo-contrib

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

click-odoo-contrib

click-odoo scripts collection

  • 1.20
  • PyPI
  • Socket score

Maintainers
2

click-odoo-contrib

.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. image:: https://badge.fury.io/py/click-odoo-contrib.svg :target: http://badge.fury.io/py/click-odoo-contrib

click-odoo-contrib is a set of useful Odoo maintenance functions. They are available as CLI scripts (based on click-odoo_), as well as composable python functions.

.. contents::

Scripts


click-odoo-copydb (beta)
------------------------

.. code::

  Usage: click-odoo-copydb [OPTIONS] SOURCE DEST

    Create an Odoo database by copying an existing one.

    This script copies using postgres CREATEDB WITH TEMPLATE. It also copies
    the filestore.

  Options:
    -c, --config FILE       ...
    ...
    -f, --force-disconnect  Attempt to disconnect users from the template
                            database.
    --unless-dest-exists    Don't report error if destination database already
                            exists.
    --if-source-exists      Don't report error if source database does not
                            exist.
    --filestore-copy-mode   [default|rsync|hardlink]
                            Mode for copying the filestore. Default uses
                            python shutil copytree which copies
                            everything. If the target filestore already
                            exists and just needs an update you can use
                            rsync to rsync the filestore instead. If both
                            filestores are on the same filesystem supporting
                            hardlinks you can use the option hardlink to hard
                            link the files to the inodes of the files of the
                            source directory which saves on space on the disk.
    --help                  Show this message and exit.

click-odoo-dropdb (stable)
--------------------------

.. code::

  Usage: click-odoo-dropdb [OPTIONS] DBNAME

    Drop an Odoo database and associated file store.

  Options:
    -c, --config FILE  ...
    ...
    --if-exists        Don't report error if database doesn't exist.
    --help             Show this message and exit.

click-odoo-initdb (stable)
--------------------------

.. code::

  Usage: click-odoo-initdb [OPTIONS]

    Create an Odoo database with pre-installed modules.

    Almost like standard Odoo does with the -i option, except this script
    manages a cache of database templates with the exact same addons
    installed. This is particularly useful to save time when initializing test
    databases.

    Cached templates are identified by computing a sha1 checksum of modules
    provided with the -m option, including their dependencies and
    corresponding auto_install modules.

  Options:
    -c, --config FILE         ...
    ...
    -n, --new-database TEXT   Name of new database to create, possibly from
                              cache. If absent, only the cache trimming
                              operation is executed.
    -m, --modules TEXT        Comma separated list of addons to install.
                              [default: base]
    --demo / --no-demo        Load Odoo demo data.  [default: True]
    --cache / --no-cache      Use a cache of database templates with the exact
                              same addons installed. Disabling this option also
                              disables all other cache-related operations such
                              as max-age or size. Note: when the cache is
                              enabled, all attachments created during database
                              initialization are stored in database instead of
                              the default Odoo file store.  [default: True]
    --cache-prefix TEXT       Prefix to use when naming cache template databases
                              (max 8 characters). CAUTION: all databases named
                              like {prefix}-____________-% will eventually be
                              dropped by the cache control mechanism, so choose
                              the prefix wisely.  [default: cache]
    --cache-max-age INTEGER   Drop cache templates that have not been used for
                              more than N days. Use -1 to disable.  [default:
                              30]
    --cache-max-size INTEGER  Keep N most recently used cache templates. Use -1
                              to disable. Use 0 to empty cache.  [default: 5]
    --unless-exists           Don't report error if database already exists.
    --help                    Show this message and exit.

click-odoo-backupdb (beta)
--------------------------

.. code::

  Usage: click-odoo-backupdb [OPTIONS] DBNAME DEST

    Create an Odoo database backup.

    This script dumps the database using pg_dump. It also copies the filestore.

    Unlike Odoo, this script allows you to make a backup of a database without
    going through the web interface. This avoids timeout and file size
    limitation problems when databases are too large.

    It also allows you to make a backup directly to a directory. This type of
    backup has the advantage that it reduces memory consumption since the
    files in the filestore are directly copied to the target directory as well
    as the database dump.

  Options:
    -c, --config FILE           ...
    ...
    --force                       Don't report error if destination file/folder
                                  already exists.  [default: False]

    --if-exists                   Don't report error if database does not exist.
    --format [zip|dump|folder]    Output format  [default: zip]
    --filestore / --no-filestore  Include filestore in backup  [default: True]
    --help                        Show this message and exit.

click-odoo-restoredb (beta)
---------------------------

.. code::

  Usage: click-odoo-restoredb [OPTIONS] DBNAME SOURCE

    Restore an Odoo database backup.

    This script allows you to restore databses created by using the Odoo web
    interface or the backupdb script. This avoids timeout and file size
    limitation problems when databases are too large.

  Options:
    -c, --config FILE  ...
    ...
    --copy / --move    This database is a copy. In order to avoid conflicts
                       between databases, Odoo needs to know if thisdatabase was
                       moved or copied. If you don't know, set is a copy.

    --force            Don't report error if destination database already
                       exists. If force and destination database exists, it will
                       be dropped before restore.  [default: False]

    --neutralize       Neutralize the database after restore. This will disable
                       scheduled actions, outgoing emails, and sets other
                       external providers in test mode. This works only in odoo
                       16.0 and above.

    --jobs INTEGER     Uses this many parallel jobs to restore. Only used to
                       restore folder format backup.

    --help             Show this message and exit.

click-odoo-makepot (stable)
---------------------------

.. code::

  Usage: click-odoo-makepot [OPTIONS]

    Export translation (.pot) files of addons installed in the database and
    present in addons_dir. Additionally, run msgmerge on the existing .po
    files to keep them up to date. Commit changes to git, if any.

  Options:
    -c, --config FILE           ...
    -d, --database TEXT         ...
    ...
    --addons-dir TEXT           [default: .]
    -m, --modules TEXT          Comma separated list of addons to export
                                translation.
    --msgmerge / --no-msgmerge  Merge .pot changes into all .po files
                                [default: False]
    --msgmerge-if-new-pot / --no-msg-merge-if-new-pot
                                Merge .pot changes into all .po files, only
                                if a new .pot file has been created.
                                [default: False]
    --fuzzy-matching /  --no-fuzzy-matching
                                Use fuzzy matching when merging .pot changes
                                into .po files.
                                Only applies when --msgmerge
                                or --msgmerge-if-new-pot are passed.
                                [default: True]
    --purge-old-translations /  --no-purge-old-translations
                                Remove comment lines containing old
                                translations from .po files.
                                Only applies when --msgmerge
                                or --msgmerge-if-new-pot are passed.
                                [default: False]
    --commit / --no-commit      Git commit exported .pot files if needed.
                                [default: False]
    --help                      Show this message and exit.

click-odoo-listdb (beta)
------------------------

.. code::

  Usage: click-odoo-listdb [OPTIONS]

    List Odoo databases.

  Options:
    -c, --config FILE  Specify the Odoo configuration file. Other ways to
                      provide it are with the ODOO_RC or OPENERP_SERVER
                      environment variables, or ~/.odoorc (Odoo >= 10) or
                      ~/.openerp_serverrc.
    --log-level TEXT   Specify the logging level. Accepted values depend on the
                      Odoo version, and include debug, info, warn, error.
                      [default: warn]
    --logfile FILE     Specify the log file.
    --help             Show this message and exit.

click-odoo-uninstall (stable)
-----------------------------

.. code::

  Usage: click-odoo-uninstall [OPTIONS]

  Options:
    -c, --config PATH    ...
    -d, --database TEXT  ...
    ...
    -m, --modules TEXT   Comma-separated list of modules to uninstall
                         [required]
    --help               Show this message and exit.

click-odoo-update (stable)
--------------------------

.. code::

  Usage: click-odoo-update [OPTIONS]

    Update an Odoo database (odoo -u), automatically detecting addons to
    update based on a hash of their file content, compared to the hashes
    stored in the database.

    It allows updating in parallel while another Odoo instance is still
    running against the same database, by using a watcher that aborts the
    update in case a DB lock happens.

  Options:
    -c, --config FILE            Specify the Odoo configuration file. Other ways
                                 to provide it are with the ODOO_RC or
                                 OPENERP_SERVER environment variables, or
                                 ~/.odoorc (Odoo >= 10) or ~/.openerp_serverrc.
    --addons-path TEXT           Specify the addons path. If present, this
                                 parameter takes precedence over the addons path
                                 provided in the Odoo configuration file.
    -d, --database TEXT          Specify the database name. If present, this
                                 parameter takes precedence over the database
                                 provided in the Odoo configuration file.
    --log-level TEXT             Specify the logging level. Accepted values
                                 depend on the Odoo version, and include debug,
                                 info, warn, error.  [default: info]
    --logfile FILE               Specify the log file.
    --i18n-overwrite             Overwrite existing translations
    --update-all                 Force a complete upgrade (-u base)
    --ignore-addons TEXT         A comma-separated list of addons to ignore.
                                 These will not be updated if their checksum has
                                 changed. Use with care.
    --ignore-core-addons         If this option is set, Odoo CE and EE addons
                                 are not updated. This is normally safe, due the
                                 Odoo stable policy.
    --if-exists                  Don't report error if database doesn't exist
    --watcher-max-seconds FLOAT  Max DB lock seconds allowed before aborting the
                                 update process. Default: 0 (disabled).
    --list-only                  Log the list of addons to update without
                                 actually updating them.
    --help                       Show this message and exit.

Useful links

.. _click-odoo: https://pypi.python.org/pypi/click-odoo

Development


To run tests, type ``tox``. Tests are made using pytest. To run tests matching
a specific keyword for, say, Odoo 12 and python 3.6, use
``tox -e py36-12.0 -- -k keyword``. For running tests you need a postgres server accessible for your user without a password at ``/var/run/postgresql/.s.PGSQL.5432``.

To make sure local coding convention are respected before
you commit, install
`pre-commit <https://github.com/pre-commit/pre-commit>`_ and
run ``pre-commit install`` after cloning the repository.

To release, create a tagged release on GitHub. This will trigger publishing to PyPI.

Credits
~~~~~~~

Contributors:

- Stéphane Bidoul (ACSONE_)
- Thomas Binsfeld (ACSONE_)
- Benjamin Willig (ACSONE_)
- Jairo Llopis
- Laurent Mignon (ACSONE_)
- Lois Rilo (ForgeFlow_)
- Dmitry Voronin

.. _ACSONE: https://acsone.eu
.. _Tecnativa: https://tecnativa.com
.. _ForgeFlow: https://forgeflow.com

Maintainer
~~~~~~~~~~

.. image:: https://www.acsone.eu/logo.png
   :alt: ACSONE SA/NV
   :target: https://www.acsone.eu

This project is maintained by ACSONE SA/NV.

Changes
~~~~~~~

.. towncrier release notes start

1.20 (2024-10-23)
-----------------

**Features**

- Odoo 18 compatibility (`#150
  <https://github.com/acsone/click-odoo-contrib/pull/150>`_, `#152
  <https://github.com/acsone/click-odoo-contrib/pull/152>`_, `#154
  <https://github.com/acsone/click-odoo-contrib/pull/154>`_)

1.19 (2024-07-22)
-----------------

**Features**

- click-odoo-restoredb: Add ``--neutralize`` option. This works only in odoo 16.0 and above. (`#143 <https://github.com/acsone/click-odoo-contrib/issues/143>`_)


1.18.1 (2023-11-16)
-------------------

**Features**

- click-odoo-update : Do not run/update Odoo when no module needs updating. (`#144 <https://github.com/acsone/click-odoo-contrib/issues/144>`_)


1.18.0 (2023-10-29)
-------------------

**Features**

- Support Odoo 17. (`#190 <https://github.com/acsone/click-odoo-contrib/issues/190>`_)


1.17.0 (2023-09-03)
-------------------

**Features**

- New ``click-odoo-listdb`` command. (`#126 <https://github.com/acsone/click-odoo-contrib/issues/126>`_)
- ``click-odoo-update``: exclude the ``tests/`` directory from checksum computation
  A modification in tests alone should not require a database upgrade. (`#125 <https://github.com/acsone/click-odoo-contrib/issues/125>`_)
- ``click-odoo-update``: set ``create_date`` and ``write_date`` on the ``ir_config_parameter`` checksums record (`#128 <https://github.com/acsone/click-odoo-contrib/issues/128>`_)


1.16.0 (2022-09-21)
-------------------

**Features**

- Add dependency on manifestoo_core to obtain Odoo core addons list (used by
  click-odoo-update to ignore core addons). (`#114 <https://github.com/acsone/click-odoo-contrib/issues/114>`_)
- Adapt click-odoo-update for Odoo 16. (`#119 <https://github.com/acsone/click-odoo-contrib/issues/119>`_)

**Deprecations and Removals**

- Remove support for Python < 3.6 and Odoo < 11. (`#110 <https://github.com/acsone/click-odoo-contrib/issues/110>`_)


1.15.1 (2021-12-04)
-------------------

**Bugfixes**

- Silence Odoo 15 noisy warnings about using autocommit. (`#105 <https://github.com/acsone/click-odoo-contrib/issues/105>`_)


1.15.0 (2021-10-06)
-------------------

**Features**

- Update core addons lists, with Odoo 15 support. (`#104 <https://github.com/acsone/click-odoo-contrib/issues/104>`_)


1.14.0 (2021-06-28)
-------------------

**Features**

- Adding a new option to enable using rsync and hardlinks for copying filestore:
  `--filestore-copy-mode [default|rsync|hardlink]`. (`#86 <https://github.com/acsone/click-odoo-contrib/issues/86>`_)


1.13.0 (2021-06-25)
-------------------

**Features**

- Backup and restore commands: add support for "dump" format (`#79 <https://github.com/acsone/click-odoo-contrib/issues/79>`_)
- ``click-odoo-makepot``: add --modules option to select modules to export. (`#92 <https://github.com/acsone/click-odoo-contrib/issues/92>`_)
- ``click-odoo-update``: also pass all modified modules in ``to upgrade`` state to
  Odoo for update; this helps upgrading when there are new dependencies, in
  combination with Odoo `#72661 <https://github.com/odoo/odoo/pull/72661>`__. (`#97 <https://github.com/acsone/click-odoo-contrib/issues/97>`_)


**Bugfixes**

- ``click-odoo-update``: do not attempt to update addons that are uninstallable. (`#89 <https://github.com/acsone/click-odoo-contrib/issues/89>`_)


1.12.0 (2020-11-25)
-------------------

**Features**

- ``click-odoo-makepot`` gained new options controlling how it merges
  new strings in existing ``.po`` files: ``--no-fuzzy-matching`` and
  ``--purge-old-translation``. (`#87 <https://github.com/acsone/click-odoo-contrib/issues/87>`_)


1.11.0 (2020-10-01)
-------------------

**Features**

- In ``click-odoo-copydb``, reset ``database.*`` system parameters, to prevent
  conflicts between databases (database.uuid, database.secret,
  database.enterprise_code, ...) (`#25 <https://github.com/acsone/click-odoo-contrib/issues/25>`_)
- Add ``click-odoo-restoredb`` command. (`#32 <https://github.com/acsone/click-odoo-contrib/issues/32>`_)
- Update core addons lists (for click-odoo-update --ignore-core-addons),
  including Odoo 14 support. (`#81 <https://github.com/acsone/click-odoo-contrib/issues/81>`_)


1.10.1 (2020-04-29)
-------------------

**Bugfixes**

- click-odoo-update: fix packaging issue (missing core addons lists). (`#77 <https://github.com/acsone/click-odoo-contrib/issues/77>`_)


1.10.0 (2020-04-28)
-------------------

**Features**

- click-odoo-initdb: add support of dot and underscore in database name. (`#35 <https://github.com/acsone/click-odoo-contrib/issues/35>`_)
- click-odoo-update: added --list-only option. (`#68 <https://github.com/acsone/click-odoo-contrib/issues/68>`_)
- click-odoo-update: add --ignore-addons and --ignore-core-addons options to
  exclude addons from checksum change detection. (`#69 <https://github.com/acsone/click-odoo-contrib/issues/69>`_)


**Improved Documentation**

- initdb, dropdb, update: move out of beta. (`#70 <https://github.com/acsone/click-odoo-contrib/issues/70>`_)


**Deprecations and Removals**

- Remove deprecated click-odoo-upgrade. (`#71 <https://github.com/acsone/click-odoo-contrib/issues/71>`_)


1.9.0 (2020-03-23)
------------------
- click-odoo-update: acquire an advisory lock on the database so multiple
  instances of click-odoo-update will not start at the same time on the
  same database (useful when there are several Odoo instances running
  on the same database and all running click-odoo-update at startup)

1.8.0 (2019-10-01)
------------------
- Support Odoo SaaS versions
- click-odoo-update now has some support for updating while another Odoo
  instance is running against the same database, by using a watcher that
  aborts the update in case a DB lock happens (this is an advanced feature)

1.7.0 (2019-09-02)
------------------
- makepot: always check validity of .po files

1.6.0 (2019-03-28)
------------------
- update: support postgres 9.4
- backupdb: work correctly when list_db is false too
- backupdb: new --(no-)filestore option
- dropdb: refactored to use Odoo api instead of custom code

1.5.0 (2019-02-05)
------------------
- add click-odoo-backupdb

1.4.1 (2018-11-21)
------------------
- fix broken click-odoo-update --i18n-overwrite

1.4.0 (2018-11-19)
------------------

- new click-odoo-update which implements the functionality of module_auto_update
  natively, alleviating the need to have module_auto_update installed in the database,
  and is more robust (it does a regular -u after identifying modules to update)
- upgrade: deprecated in favor of click-odoo-update
- initdb: save installed checksums so click-odoo-update can readily use them
- initdb: add --addons-path option
- copydb: fix error when source filestore did not exist

1.3.1 (2018-11-05)
------------------
- Add --unless-exists option to click-odoo-initdb

1.3.0 (2018-10-31)
------------------
- Add click-odoo-copydb
- Add click-odoo-dropdb
- Add --if-exists option to click-odoo-upgrade

1.2.0 (2018-10-07)
------------------
- Odoo 12 support

1.1.4 (2018-06-21)
------------------
- makepot: fix issue when addons-dir is not current directory
  (this should also fix issues when there are symlinks)

1.1.3 (2018-06-20)
------------------
- makepot: add --commit-message option

1.1.2 (2018-06-20)
------------------
- makepot: force git add in case .pot are in .gitignore
  (made for https://github.com/OCA/maintainer-quality-tools/issues/558)

1.1.1 (2018-06-16)
------------------
- makepot: add --msgmerge-if-new-pot option

1.1.0 (2018-06-13, Sevilla OCA code sprint)
-------------------------------------------
- add click-odoo-makepot
- in click-odoo-initdb, include active=True modules in hash computation
  (because modules with active=True are auto installed by Odoo)

1.0.4 (2018-06-02)
------------------
- update module list after creating a database from cache, useful when
  we are creating a database in an environment where modules have
  been added since the template was created

1.0.3 (2018-05-30)
------------------
- fix: handle situations where two initdb start at the same time
  ending up with an "already exists" error when creating the cached template

1.0.2 (2018-05-29)
------------------
- fix: initdb now stores attachments in database when cache is enabled,
  so databases created from cache do not miss the filestore

1.0.1 (2018-05-27)
------------------
- better documentation
- fix: initdb now takes auto_install modules into account

1.0.0 (2018-05-27)
------------------
- add click-odoo-initdb

1.0.0b3 (2018-05-17)
--------------------
- be more robust in rare case button_upgrade fails silently

1.0.0b2 (2018-03-28)
--------------------
- uninstall: commit and hide --rollback
- upgrade: refactor to add composable function


1.0.0b1 (2018-03-28)
--------------------
- upgrade: save installed checksums after full upgrade


1.0.0a1 (2018-03-22)
--------------------
- first alpha
- click-odoo-uninstall
- click-odoo-upgrade

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc