Skip to content

blaggacao/click-odoo-contrib

 
 

Repository files navigation

click-odoo-contrib

License: LGPL-3

image

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.

Scripts

click-odoo-copydb (beta)

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.
  --help                  Show this message and exit.

click-odoo-dropdb (beta)

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 (beta)

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]
  --help                    Show this message and exit.

click-odoo-makepot (stable)

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: .]
  --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]
  --commit / --no-commit      Git commit exported .pot files if needed.
                              [default: False]
  --help                      Show this message and exit.

click-odoo-uninstall (stable)

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-upgrade (stable)

Usage: click-odoo-upgrade [OPTIONS]

  Upgrade an Odoo database (odoo -u), taking advantage of
  module_auto_update's upgrade_changed_checksum method if present.

Options:
  -c, --config FILE    ...
  -d, --database TEXT  ...
  ...
  --i18n-overwrite     Overwrite existing translations
  --upgrade-all        Force a complete upgrade (-u base)
  --if-exists          Don't report error if database doesn't exist.
  --help               Show this message and exit.

Developement

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.

This project uses black as code formatting convention, as well as isort and flake8. To make sure local coding convention are respected before you commit, install pre-commit and run pre-commit install after cloning the repository.

Credits

Contributors:

Maintainer

ACSONE SA/NV

This project is maintained by ACSONE SA/NV.

About

Useful Odoo scripts and utility functions, based on click-odoo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%