Compare commits

...

5 Commits

Author SHA1 Message Date
Paolo Gatti
4cd1011d10 [IMP] developer: new CLI commands and improvements
Added the new `i18n` and `module` commands.
Added the existing `deploy`, `obfuscate`, `upgrade_code` commands.
Reviewed titles to make the commands stand out in the ToC.
Removed the no longer present `tsconfig` command.

task-4866527
2025-09-12 12:09:19 +02:00
larm-odoo
77754abdb7 [IMP] Payroll: Removing salary attachment report
closes odoo/documentation#14536

X-original-commit: 73469dcb76
Signed-off-by: Lara Martini (larm) <larm@odoo.com>
2025-09-12 00:49:23 +00:00
larm-odoo
c290c7a5a9 [ADD] Payroll: Time Off To Report
closes odoo/documentation#14537

X-original-commit: c5f717344c
Signed-off-by: Felicia Kuan (feku) <feku@odoo.com>
Signed-off-by: Lara Martini (larm) <larm@odoo.com>
2025-09-12 00:49:22 +00:00
masp-odoo
1757c90cd3 [IMP] website: create menu with cards for webdesign
task-5051186

closes odoo/documentation#14538

X-original-commit: 8d53aff7ef
Signed-off-by: Audrey Vandromme (auva) <auva@odoo.com>
2025-09-11 18:43:59 +00:00
Christophe Monniez
5838fa7e90 [REL] 19.0 2025-09-11 07:02:13 +00:00
18 changed files with 785 additions and 221 deletions

View File

@@ -27,7 +27,7 @@ SOURCE_DIR = content
HTML_BUILD_DIR = $(BUILD_DIR)/html
ifdef VERSIONS
HTML_BUILD_DIR := $(HTML_BUILD_DIR)/master
HTML_BUILD_DIR := $(HTML_BUILD_DIR)/19.0
endif
ifneq ($(CURRENT_LANG),en)
HTML_BUILD_DIR := $(HTML_BUILD_DIR)/$(CURRENT_LANG)

View File

@@ -22,7 +22,7 @@ copyright = 'Odoo S.A.'
# `version` is the version info for the project being documented, acts as replacement for |version|,
# also used in various other places throughout the built documents.
# `release` is the full version, including a/b/rc tags. Acts as replacement for |release|.
version = release = 'master'
version = release = '19.0'
# `current_branch` is the technical name of the current branch.
# E.g., saas-15.4 -> saas-15.4; 12.0 -> 12.0, master -> master (*).
@@ -232,6 +232,7 @@ sphinx.transforms.i18n.docname_to_domain = (
# option. If a provided version has no label, the version string is used as label.
versions_names = {
'master': "Master",
'19.0': "Odoo 19",
'saas-18.4': "Odoo 18.4",
'saas-18.3': "Odoo 18.3",
'saas-18.2': "Odoo 18.2",

View File

@@ -895,13 +895,13 @@ form.
.. seealso::
- :doc:`payroll/contracts`
- :doc:`payroll/work_entries`
- :doc:`payroll/time_off_to_report`
- :doc:`payroll/salary_attachments`
- :doc:`payroll/payslips`
- :doc:`payroll/batches`
- :doc:`payroll/commissions`
- :doc:`payroll/reporting`
- :doc:`payroll/work_entry_analysis`
- :doc:`payroll/salary_attachment`
- :doc:`payroll/payroll_localizations`
.. toctree::
@@ -909,11 +909,11 @@ form.
payroll/contracts
payroll/work_entries
payroll/time_off_to_report
payroll/salary_attachments
payroll/payslips
payroll/batches
payroll/commissions
payroll/reporting
payroll/work_entry_analysis
payroll/salary_attachment
payroll/payroll_localizations

View File

@@ -1,63 +0,0 @@
========================
Salary attachment report
========================
*Salary attachments* in Odoo refer to a portion of an employee's earnings that are designated for
a specific purpose, both voluntary and involuntary. These can include contributions to a retirement
plan, repayment of a loan, wage garnishments, or child support.
Voluntary salary attachments, such as repaying a loan, or contributing to a charity on a monthly
basis, are considered *Assignments of Salary* in Odoo. Salary attachments that are required, such as
a lawsuit settlement repayment, or repaying a tax lien, are considered *Attachments of Salary* in
Odoo. Child support payments have their own category, and are simply referred to as *Child Support*
in Odoo.
To view this report, navigate to :menuselection:`Payroll app --> Reporting --> Salary Attachment
Report`. The :guilabel:`Salary Attachment Report` shows all deductions or allocations per employee,
organized by payslip, in a default pivot table. The default filter is the end of the current year
(:guilabel:`Payslip End Date: (year)`). The employees populate the rows, while the various
deductions populate the columns, organized by type of deduction, and further grouped by individual
payslip.
The default report contains **all** payslips for the current year, so the report typically contains
a large number of columns. This could make it difficult to view all the data at once, as the report
may be very wide and require scrolling to view all the data.
To view a condensed version of salary attachments, and have all the salary attachment columns
visible on one page, click the :icon:`fa-minus-square-o` :guilabel:`Total` icon at the top of the
report, above the various payslips.
This presents the salary attachments for the current year, and only displays three columns,
:guilabel:`Attachment of Salary`, :guilabel:`Assignment of Salary`, and :guilabel:`Child Support.`
Each entry displays the total amount paid for each specific type of salary attachment, for each
employee.
.. image:: salary_attachment/salary-attachment.png
:alt: The Attachment of Salary report that shows all salary garnishments in a condensed view.
The report can be downloaded as an XLSX file, or :doc:`inserted into a spreadsheet
<../../productivity/spreadsheet/insert>` using the corresponding buttons at the top.
Click the :guilabel:`Measures` button to reveal the options of what data is displayed.
:guilabel:`Assignment of salary`, :guilabel:`Attachment of salary`, and :guilabel:`Child support`
are all selected and visible, by default, while the :guilabel:`Count` option is not.
Click an option to either show or hide that particular metric. A :icon:`fa-check`
:guilabel:`(checkmark)` icon indicates the data is visible.
Compare to previous year
========================
The :guilabel:`Salary Attachment Report` can be compared to the report for the previous time period
or the previous year.
To view these comparisons, click the :icon:`fa-caret-down` :guilabel:`(down arrow)` icon in the
search bar, then click either :guilabel:`Payslip End Date: Previous Period` or :guilabel:`Payslip
End Date: Previous Year`, beneath the :icon:`fa-adjust` :guilabel:`Comparison` column.
The report updates and displays the current time period values, and the previous time period values,
as well as the :guilabel:`Variation` between the two, in a percentage.
.. image:: salary_attachment/comparison-attachment.png
:alt: The salary attachment report modified to compare to the previous year.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -163,6 +163,3 @@ Any salary attachment can be cancelled at any time. To cancel a salary attachmen
individual attachment record from the main :guilabel:`Salary Attachment` dashboard to open the
record. From the :guilabel:`Salary Attachment` record, click the :guilabel:`Cancel` button to cancel
the salary attachment, and stop having the designated money taken out of future paychecks.
.. seealso::
:doc:`salary_attachment`

View File

@@ -0,0 +1,77 @@
==================
Time off to report
==================
Payroll is often processed a few days before the end of a pay period, so that employees can be paid
in a timely manner. When work schedules are predictable, this method often works. However, sometimes
employees take time off unexpectedly, especially sick time. When this occurs, there can be
discrepancies in payroll that must be addressed.
.. example::
The payroll department for a medium-sized company processes paychecks every two weeks, on
Wednesdays. Each employee is paid on the Friday after.
One employee is sick on the last Thursday and Friday of the two-week pay period. Since they have
automatically generated work entries based on their working schedule, and payroll is processed on
Wednesdays, the paycheck they receive incorrectly states that they were paid for a regular work
day for all ten days of the two-week pay period.
Instead of cancelling the paycheck and reissuing it, causing delays for the employee and more
work for the payroll department, Odoo allows for the deferral of the time off taken, to the
following pay period.
This ensures all time off balances are correct, and the employee is properly compensated for
their time.
.. _payroll/time-off-dashboard:
Time off dashboard
==================
When time off requests are submitted for a time period that was already processed on a payslip, the
time off requests appear in the *Time Off* page of the **Payroll** app. To access this, navigate to
:menuselection:`Payroll app --> Work Entries --> Time Off to Report`.
The :guilabel:`Time Off` page default filter is :guilabel:`To Defer`, and displays all requests with
a :guilabel:`Payslip State` of :guilabel:`To defer to next payslip`. This is because the employee
was *already paid* for that time as worked time, and it was logged as regular time spent at work.
.. image:: time_off_to_report/time-off-to-report.png
:alt: A list of all time off requests that were not approved before payslips were generated.
Defer multiple time off entries
===============================
In order to keep the employee's time off balances correct, the time off request **must** be applied
to the following pay period. This not only ensures time off request balances are current, it also
eliminates the need to redo work entries, cancel paychecks, and reissue paychecks.
To select the work entries to defer, tick the box to the left of the work entry line on the
:ref:`Time Off page <payroll/time-off-dashboard>`. To select all work entries in the list, tick the
box to the left of the :guilabel:`Employee` column title, at the top of the list.
Once any work entry is selected, two buttons appear at the top of the report: a :guilabel:`(#)
selected` button, and an :icon:`fa-gear` :guilabel:`Actions` button. The :guilabel:`(#) selected`
button indicates how many entries are currently selected.
When all the desired work entries are selected, click the :icon:`fa-gear` :guilabel:`Actions`
button, and a menu appears with several choices. Click :guilabel:`Defer to Next Month` in the list,
and all selected entries are deferred to the following month.
Defer individual time off entries
=================================
Time off requests appearing on the :ref:`Time Off page <payroll/time-off-dashboard>` can be deferred
individually. Click on an individual time off request, and the details for that request load.
The specific details for the time off request appear on the left-hand side, and all of the
employee's submitted time off requests appear on the right-hand side (including the request in the
details on the left-hand side).
To defer the time off request to the next payslip, click the :guilabel:`Report to Next Month` button
in the upper-left corner. Once processed, the :guilabel:`Report to Next Month` button disappears,
and the :guilabel:`Payslip State` changes from :guilabel:`To defer to next payslip` to
:guilabel:`Computed in Current Payslip`.
.. image:: time_off_to_report/single-defer.png
:alt: The time off details for an individual request that needs to be deferred.

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -259,81 +259,3 @@ Click the :guilabel:`Print` button, and a PDF file is created with all the speci
.. note::
The :guilabel:`Print` button does **not** appear until at least one payslip is selected in the
list.
Time off to report
==================
If a time off request is submitted for a time period that was already processed on a payslip, the
time off request appears in the *Time Off* page in the *Payroll* app, which is accessible by
navigating to :menuselection:`Payroll app --> Work Entries --> Time Off to Report`.
On the :guilabel:`Time Off` page, the request appears with a status of :guilabel:`To defer to next
payslip`. This is because the employee was already paid for that day, and it was logged as time
spent at work, as a typical work day.
In order to keep the employee's time off balances correct, the time off request **must** be applied
to the following pay period. This not only ensures time off request balances are current, it also
eliminates the need to redo work entries, cancel paychecks, and reissue paychecks.
The most common scenario when this situation occurs, is when payslips are processed a day or two
before the pay period ends, and an employee is unexpectedly sick on one of the last days of the pay
period. The employee puts in a time off request for a day that was already processed on a payslip as
a regular work day. Instead of cancelling the payslip, modifying the work entries, and reissuing the
paycheck, Odoo allows for those time off requests to be applied to the following pay period,
instead.
To view all the time off requests that need to be deferred to the next payslip, navigate to
:menuselection:`Payroll app --> Work Entries --> Time Off to Report`. The default filter for this
report is :guilabel:`To Defer`.
All time off requests that need to be applied to the following pay period appear with a
:guilabel:`Payslip State` of :guilabel:`To defer to next payslip`.
.. image:: work_entries/time-off-to-report.png
:align: center
:alt: A list of all time off requests that were not approved before payslips were generated.
Defer multiple time off entries
-------------------------------
To select the work entries to defer, click the box to the left of the work entry line. To select all
work entries in the list, click the box to the left of the :guilabel:`Employees` column title, at
the top of the list.
Once any work entry is selected, two buttons appear at the top of the report: a :guilabel:`(#)
Selected` button, and an :guilabel:`Actions` button. The :guilabel:`(#) Selected` button indicates
how many entries are currently selected.
When all the desired work entries are selected, click the :guilabel:`Actions` button, and a menu
appears with several choices. Click :guilabel:`Defer to Next Month` in the list, and all selected
entries are deferred to the following month.
.. image:: work_entries/batch-defer.png
:align: center
:alt: The actions button and # Selected buttons that appear after any selections are made.
Defer individual time off entries
---------------------------------
Time off requests appearing on the :guilabel:`Time Off to Report` list can be deferred individually.
Click on an individual time off request, and the details for that request load.
The specific details for the time off request appear on the left-hand side, and all of the
employee's submitted time off requests appear on the right-hand side (including the request in the
details on the left-hand side).
To defer the time off request to the next payslip, click the :guilabel:`Report to Next Month` button
at the top. Once processed, the :guilabel:`Report to Next Month` button disappears, and the
:guilabel:`Payslip State` changes from :guilabel:`To defer to next payslip` to :guilabel:`Computed
in Current Payslip`.
To go back to the :guilabel:`Time Off to Report` list, click on :guilabel:`Time Off` in the
breadcrumb menu.
.. image:: work_entries/single-defer.png
:align: center
:alt: The time off details for an individual request that needs to be deferred.
.. seealso::
:ref:`Configure work entries <payroll/work-entries-config>`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,9 +1,46 @@
:nosearch:
:show-content:
:hide-page-toc:
==========
Web design
==========
Design your website using :doc:`building blocks <../website/web_design/building_blocks>`, customize
its :doc:`theme <../website/web_design/themes>` with various options, structure and present content
with :doc:`elements <../website/web_design/elements>`, and display or hide building blocks using
:doc:`visibility settings <../website/web_design/visibility>`.
.. cards::
.. card:: Building blocks
:target: web_design/building_blocks
:large:
Design your website by dragging and dropping building blocks, then editing them to fit your
content and layout needs.
.. card:: General theme
:target: web_design/themes
:large:
Customize your websites theme by adjusting its colors, fonts, and layout.
.. card:: Elements
:target: web_design/elements
:large:
Structure and present content effectively with elements such as titles, lists, etc.
.. card:: Visibility
:target: web_design/visibility
:large:
Display or hide building blocks based on several criteria.
.. seealso::
`Odoo Tutorials: Website <https://www.odoo.com/slides/website-25>`_
.. toctree::
:titlesonly:

View File

@@ -34,16 +34,20 @@ environment <reference/cmdline/shell>`, :ref:`scaffold an Odoo module <reference
Please refer to the `documentation of the official Docker image of Odoo
<https://hub.docker.com/_/odoo/>`_.
.. _reference/cmdline/help:
.. _reference/cmdline/extra:
Help & version
==============
Version
=======
.. program:: odoo-bin
.. option:: -h, --help
shows help text with all available options
it can be used in combination with any command available, and it displays
the options of the current command.
If no command is used, it will act as per the `help` command
:ref:`below <reference/cmdline/help>`.
.. option:: --version
@@ -53,17 +57,29 @@ Help & version
.. code-block:: bash
echo "complete -W '`./odoo-bin --help | \
sed -e 's/[^a-z_-]\(-\+[a-z0-9_-]\+\)/\n\1\n/' | \
grep -- '^-' | sort | uniq | tr '\n' ' '`' odoo-bin" >> ~/.bash_completion
COMMANDS=$(odoo-bin --help | sed -e "s/^ \([^ ]\+\).*$/ \1/gp;d" | xargs)
echo "complete -W '$COMMANDS' odoo-bin" >> ~/.bash_completion
.. _reference/cmdline/help:
`help` - Show available commands
================================
.. program:: odoo-bin help
This command shows all the available commands for Odoo.
It has no options.
.. _reference/cmdline/server:
Running the server
==================
`server` - Run the Server
=========================
.. program:: odoo-bin
This command is the default one: you can omit it, and it will be chosen anyway.
.. option:: -d <database>, --database <database>
database(s) used when installing or updating modules.
@@ -74,8 +90,7 @@ Running the server
.. option:: -i <modules>, --init <modules>
comma-separated list of modules to install before running the server
(requires :option:`-d`).
comma-separated list of modules to install before running the server (requires :option:`-d`).
.. option:: -u <modules>, --update <modules>
@@ -169,8 +184,8 @@ Running the server
.. _reference/cmdline/testing:
Testing Configuration
=====================
Testing
-------
.. option:: --test-enable
@@ -371,39 +386,16 @@ Emails
Internationalisation
--------------------
Use these options to translate Odoo to another language. See i18n section of
the user manual. Option '-d' is mandatory. Option '-l' is mandatory in case
of importation
.. option:: --load-language <languages>
specifies the languages (separated by commas) for the translations you
want to be loaded
.. option:: -l, --language <language>
specify the language of the translation file. Use it with --i18n-export
or --i18n-import
.. option:: --i18n-export <filename>
export all sentences to be translated to a CSV file, a PO file or a TGZ
archive and exit.
.. option:: --i18n-import <filename>
import a CSV or a PO file with translations and exit. The '-l' option is
required.
.. option:: --i18n-overwrite
overwrites existing translation terms on updating a module or importing
a CSV or a PO file.
.. option:: --modules
specify modules to export. Use in combination with --i18n-export
.. _reference/cmdline/advanced:
Advanced Options
@@ -673,8 +665,6 @@ Some conversions don't match the pattern:
``log_handler``, use that directly in the configuration file
* :option:`--smtp` is stored as ``smtp_server``
* :option:`--database` is stored as ``db_name``
* :option:`--i18n-import` and :option:`--i18n-export` aren't available at all
from configuration files
.. _reference/cmdline/config_file:
@@ -706,13 +696,15 @@ Here is a sample file:
https://werkzeug.palletsprojects.com/en/0.16.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
.. _pyinotify: https://github.com/seb-m/pyinotify/wiki
.. _reference/cmdline/shell:
Shell
=====
`shell` - Open a Shell
======================
The Odoo command line also allows launching Odoo as a Python console environment, enabling direct
interaction with the :ref:`orm <reference/orm>` and its functionalities.
interaction with the :ref:`orm <reference/orm>` and its functionalities. Since running a shell
involves starting the server, the configuration file options do apply.
.. code-block:: console
@@ -750,13 +742,432 @@ interaction with the :ref:`orm <reference/orm>` and its functionalities.
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::
:ref:`reference/orm/environment`
.. _reference/cmdline/scaffold:
Neutralize
==========
.. _reference/cmdline/db:
`db` - Manage a Database
========================
.. program:: odoo-bin db
This command lets you manage databases through a command-line interface. The operations are
specified using subcommands.
For all subcommands, these options to configure your environment are available:
- :option:`--addons-path <odoo-bin --addons-path>`
- :option:`--config <odoo-bin -c>`
- :option:`--data-dir <odoo-bin -d>`
- :option:`--db_user <odoo-bin --db_user>`
- :option:`--db_password <odoo-bin --db_password>`
- :option:`--db_host <odoo-bin --db_host>`
- :option:`--db_port <odoo-bin --db_port>`
- :option:`--db_sslmode <odoo-bin --db_sslmode>`
- :option:`--pg_path <odoo-bin --pg_path>`
.. _reference/cmdline/db/init:
`db init` - Initialize a Database
---------------------------------
.. program:: odoo-bin db init
This command creates a new database and installs the `base` module. You can specify the
language and country of the main company.
.. code-block:: console
$ odoo-bin db init <database>
.. option:: database
Name of the database to be initialized.
.. option:: --with-demo
Install demo data in the initialized database.
.. option:: --force
Delete the database if it already exists, before initializing the new one.
.. option:: --country <country_iso_code>
Code of the country to be set on the main company
.. option:: --language <language_code>
Default language for the instance, default `en_US`
.. option:: --username <password>
Username for the new database, default `admin`
.. option:: --password <password>
Password for the new database, default `admin`
.. _reference/cmdline/db/dump:
`db dump` - Save a Database Dump
--------------------------------
.. program:: odoo-bin db dump
Creates a dump file.
.. code-block:: console
$ odoo-bin db dump <database> <dump_path>
.. option:: database
Name of the database to dump.
.. option:: dump_path
(Optional) Database is dumped to specified path. By default it is dumped
to `stdout`.
.. option:: --format <zip | dump>
If provided, database is dumped used the specified format.
Supported formats are `zip` (default), `dump` (pg_dump format).
.. option:: --no-filestore
If provided, zip database is dumped without filestore
.. _reference/cmdline/db/load:
`db load` - Load a Database Dump
--------------------------------
.. program:: odoo-bin db load
Loads a dump file into an Odoo database, the dump file can be a URL.
.. code-block:: console
$ odoo-bin db load <database> <dump_file>
.. option:: database
(Optional) Name of the database to create from the dump.
If not provided, the dump filename without extension is used.
.. option:: dump_file
`.zip` or `pg_dump` file to be loaded.
.. option:: -f,--force
Delete the database if it already exists, before loading the new one.
.. option:: -n,--neutralize
Neutralize the database after restoring it.
.. _reference/cmdline/db/duplicate:
`db duplicate` - Duplicate a Database
-------------------------------------
.. program:: odoo-bin db duplicate
Duplicate a database including filestore.
.. code-block:: console
$ odoo-bin db duplicate <source> <target>
.. option:: source
Name of the source database.
.. option:: target
Name of the target database.
.. option:: -n,--neutralize
Neutralize the database, after restoring it.
.. option:: -f,--force
Delete the target database if it already exists, before initializing the new one.
.. _reference/cmdline/db/rename:
`db rename` - Rename a Database
-------------------------------
.. program:: odoo-bin db rename
Rename a database from an old name to a new one.
.. code-block:: console
$ odoo-bin db rename <source> <target>
.. option:: source
Current name of the database.
.. option:: target
New name for the database.
.. option:: -f,--force
Delete the target database if it already exists, before renaming the source one.
.. _reference/cmdline/db/drop:
`db drop` - Delete a Database
-----------------------------
.. code-block:: console
$ odoo-bin db drop <database>
.. program:: odoo-bin db drop
.. option:: database
Name of the database to drop.
.. _reference/cmdline/i18n:
`i18n` - Internationalization
=============================
.. program:: odoo-bin i18n
This command has subcommands that enable you to import or export internationalization files
and setup languages on the Odoo instance.
For all subcommands, these options to configure your environment are available:
- :option:`--addons-path <odoo-bin --addons-path>`
- :option:`--config <odoo-bin -c>`
- :option:`--database <odoo-bin --database>`
.. note::
Language codes must follow the XPG (POSIX) locale format.
To list available codes, you can search them querying the database:
.. code-block:: console
$ psql -d <dbname> -c "SELECT iso_code FROM res_lang ORDER BY iso_code"
.. seealso::
`GNU libc Locale Names <https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html>`_
.. example::
.. code-block:: console
$ odoo-bin i18n loadlang -l en # English (U.S.)
$ odoo-bin i18n loadlang -l es es_AR # Spanish (Spain, Argentina)
$ odoo-bin i18n loadlang -l sr@latin # Serbian (Latin)
.. _reference/cmdline/i18n/import:
`i18n import` - Import i18n files
---------------------------------
.. program:: odoo-bin i18n import
This command imports provided translation files in the `.po` or `.csv` formats.
By default, only new entries will be added, but you can choose to overwrite
existing terms. All the files must refer to the specified language.
.. code-block:: console
$ odoo-bin i18n import <files> --overwrite --language <language_code>
.. option:: files
| List of files to be imported.
| Allowed extensions: `.po`, `.csv`.
.. option:: -l,--language
(Required) Language code of the translations in the files.
.. option:: -w,--overwrite
Overwrite existing translation when importing.
.. _reference/cmdline/i18n/export:
`i18n export` - Export i18n files
---------------------------------
.. program:: odoo-bin i18n export
This command exports existing translation terms for modules in the Odoo database
to a range of formats: `.po`, `.pot`, `.tgz`, `.csv`. In case of `.po` and `.pot`
files, they will be created under the `i18n/` folder of the module they belong to.
If you specify an output parameter, only one language can be selected, and all
the output will refer to that language.
The `.tgz` output format makes all output be archived in a single file.
.. code-block:: console
$ odoo-bin i18n export <modules> --languages <language_codes>
.. option:: modules
List of modules you want to export the internationalization files from.
.. option:: -l,--languages <languages>
List of language codes you want to export, `pot` for template (default).
.. option:: -o,--output
| Path of an only output file with translations from all provided modules.
| Allowed extensions: `.po`, `.pot`, `.tgz`, `.csv`
| If `-` is provided, the content is written as a `.po` file to stdout.
Only one language is allowed when this option is active.
.. _reference/cmdline/i18n/loadlang:
`i18n loadlang` - Load language
-------------------------------
.. program:: odoo-bin i18n loadlang
This command loads one of the available languages into the Odoo database and activates it.
.. code-block:: console
$ odoo-bin i18n loadlang <languages>
.. option:: languages
language codes of the languages to be installed.
.. _reference/cmdline/module:
`module` - Manage modules
=========================
.. program:: odoo-bin module
This command has subcommands that enable you to install, uninstall and upgrade modules
on the Odoo instance. There's also a command to force install the demo data into the
database.
For all subcommands, these options are available:
- :option:`--addons-path <odoo-bin --addons-path>`
- :option:`--config <odoo-bin -c>`
- :option:`--database <odoo-bin --database>`
.. _reference/cmdline/module/install:
`module install` - Install modules
----------------------------------
.. program:: odoo-bin module install
This command installs all selected modules straight away.
Before installing modules, the Odoo database needs to be created and initialized
on your PostgreSQL instance, e.g. using the :ref:`reference/cmdline/db/init` command.
.. code-block:: console
$ odoo-bin module install <modules>
.. option:: modules
List of modules you want to install.
.. _reference/cmdline/module/uninstall:
`module uninstall` - Uninstall modules
--------------------------------------
.. program:: odoo-bin module uninstall
This command uninstalls all selected modules straight away.
.. code-block:: console
$ odoo-bin module uninstall <modules>
.. option:: modules
List of modules you want to uninstall.
.. _reference/cmdline/module/upgrade:
`module upgrade` - Upgrade modules
----------------------------------
.. program:: odoo-bin module upgrade
This command upgrades all selected modules straight away.
.. code-block:: console
$ odoo-bin module upgrade <modules>
.. option:: modules
List of modules you want to upgrade.
.. option:: --outdated
Only update modules that have a newer version on disk.
.. _reference/cmdline/module`u/forcedemo:
`module forcedemo` - Force demo data install
--------------------------------------------
.. program:: odoo-bin module forcedemo
This command forces the installation of :ref:`Demo Data <tutorials/define_module_data/demo_data>`
.. warning::
Once installed, there is no way to undo it, so you might want to save a backup of the database
first with the command :ref:`db dump <reference/cmdline/db/dump>`
There are no additional options to this command.
.. _reference/cmdline/neutralize:
`neutralize` - Neutralize a Database
====================================
.. program:: odoo-bin neutralize
@@ -765,9 +1176,9 @@ database option.
.. code-block:: console
$ odoo-bin --addons-path <PATH,...> neutralize -d <database>
$ odoo-bin --addons-path <PATH,...> neutralize -d <database>
.. option:: -d <database, --database <database>
.. option:: -d <database>, --database <database>
Specify the database name that you would like to neutralize.
@@ -779,8 +1190,10 @@ database option.
.. seealso::
:doc:`../../administration/neutralized_database`
Scaffolding
===========
.. _reference/cmdline/scaffold:
`scaffold` - Scaffold a Module
==============================
.. program:: odoo-bin scaffold
@@ -815,8 +1228,8 @@ This will create module *my_module* in directory */addons/*.
.. _reference/cmdline/populate:
Database population
===================
`populate` - Populate a Database
================================
.. program:: odoo-bin populate
@@ -833,32 +1246,35 @@ It also follows x2Many relationships.
name of the database to populate
.. option:: --models
.. option:: --models <models>
list of models to populate. Models appearing twice will only be populated once.
.. option:: --factors
.. option:: --factors <factors>
list of populate factors. In case a factor is missing for a model, the last factor in
the list will be used.
.. option:: --sep
.. option:: --sep <separator>
separator used to generate record names
.. _reference/cmdline/cloc:
Cloc
====
`cloc` - Count Lines of Code
============================
.. program:: odoo-bin cloc
Odoo Cloc is a tool to count the number of relevant lines written in
Odoo Cloc is a tool to count the number of relevant lines of code written in
Python, Javascript, CSS, SCSS, or XML. This can be used as a rough metric for pricing
maintenance of extra modules.
Command-line options
--------------------
.. code-block:: console
$ odoo-bin cloc -c config.conf -d my_database
.. option:: -d <database>, --database <database>
| Process the code of all extra modules installed on the provided database,
@@ -911,10 +1327,6 @@ Multiple paths can be provided by repeating the option.
Specify a configuration file to use in place of the :option:`--addons-path` option.
.. code-block:: console
$ odoo-bin cloc -c config.conf -d my_database
.. option:: -v, --verbose
@@ -1003,20 +1415,198 @@ load. If the module works despite the presence of those files, they are probably
not loaded and should therefore be removed from the module, or at least excluded
in the manifest via ``cloc_exclude``.
TSConfig Generator
==================
.. program:: odoo-bin tsconfig
.. _reference/cmdline/obfuscate:
When working on javascript, there are ways to help your editor providing you with
powerful auto-completion. One of those ways is the use of a tsconfig.json file.
Originally meant for typescript, editors can use its information with plain javascript also.
With this config file, you will now have full auto-completion across modules.
`obfuscate` - Obfuscate database
================================
The command to generate this files takes as many unnamed arguments as you need. Those are relative paths
to your addon directories. In the example below, we move up one folder to save the tsconfig file in the folder
containing community and enterprise.
.. program:: odoo-bin obfuscate
This command provides a quick and easy way to obfuscate some of the data in the
Odoo instance, mainly used for instructional purposes or to make quick videos for
the support team helping technicians avoid leaking sensitive information.
.. warning::
This command must be used carefully, as it is **not** considered a safe method
for full anonymizing data before transfer to a third party. Images, PDF
attachments, amounts, many other informations may not be obfuscated and cause
sensitive information leaks. A thorough review is required before sharing data
to ensure that no sensitive information is exposed.
Obfuscation is symmetric, so content can be unobfuscated using the same password.
All the configurations available for the :ref:`server <reference/cmdline/server>`
command are available here too.
.. code-block:: console
$ community/odoo-bin tsconfig --addons-path community/addons,community/odoo/addons,enterprise > tsconfig.json
$ odoo-bin obfuscate --pwd=<password>
.. option:: --pwd <password>
(Required) the password that will be used to symmetrically obfuscate content.
.. option:: --unobfuscate
if you want to unobfuscate instead of obfuscate.
.. option:: --fields <fields>
comma-separated list of `table.column` entries to obfuscate/unobfuscate.
.. option:: --file <file>
file containing the list of `table.column` entries to obfuscate/unobfuscate.
.. option:: --exclude
comma-separated list of `table.column` entries not to obfuscate/unobfuscate.
.. option:: --allfields
used only when :option:`--unobfuscate` is selected.
Try to unobfuscate all fields. It's slower than specifying the fields manually.
.. option:: --vacuum
used only when :option:`--unobfuscate` is selected.
After unobfuscation, completely clear the obfuscated tables and reclaim unused disk space.
.. option:: --pertablecommit
commit once per table, after obfuscation.
It avoids big transactions that might get a timeout or face rollback after an error.
.. option:: -y,--yes
don't ask for manual confirmation.
Only use if you're sure that you're not going to leak sensible information by sharing
the database to third party without a review.
.. _reference/cmdline/deploy:
`deploy` - Deploy module remotely
=================================
.. program:: odoo-bin deploy
This command uploads a module to a remote Odoo server and installs it.
It's simpler than manually connecting to the remote server, and it does not require full access
to the machine that hosts the Odoo instance, only the Odoo administrative credentials.
.. code-block:: console
$ odoo-bin deploy <path> <url> --db <dbname> --login <login> --password <password>
.. note::
Prerequisites:
- The server must have the module `base_import_module` installed.
- The user selected with the `--login` option must have administrative rights.
.. option:: path
path of the module to be deployed
.. option:: url
(Optional) url of the server where the module must be deployed
(default `http://localhost:8069`)
.. option:: db <dbname>
database name (if the server does not use the `--db-filter` option)
.. option:: --login <username>
name of the user with admin rights (default `admin`)
.. option:: --password <password>
password of the user with admin rights (default `admin`)
.. option:: --verify-ssl
verify the server's SSL certificate, to ensure the target instance is legit.
.. option:: --force
re-initialize the module in case it's already installed. It will update
`noupdate="1"` records.
.. _reference/cmdline/upgrade_code:
`upgrade_code` - Rewrite source code
====================================
.. program:: odoo-bin upgrade_code
This command rewrites the entire source code using the scripts found in the
`odoo/upgrade_code` folder. It is used for doing the heavy-lifting when
dealing with big code migrations and forward ports.
.. note::
All the scripts are doing a best-effort at migrating the source code, but
they are not silver bullets.
It accepts the :option:`--addons-path <odoo-bin --addons-path>` option.
.. code-block:: console
$ odoo-bin upgrade_code --from 18.0 --to 19.0 --dry-run
.. option:: --script <path>
run a single script
.. option:: --from <version>
run all script starting from this version included
.. option:: --to <version>
to be used with :option:`--from`. Run all scripts up to this version included.
Default is `odoo.release.version`.
.. option:: --glob <glob>
filter the files to be rewritten, default is every file (`\*\*/\*`)
.. option:: --dry-run
list the files that would be re-written, but do not apply changes
Code upgrade scripts
--------------------
The scripts must be named `{version}-{name}.py`, and must expose an `upgrade`
function that takes a single `file_manager` argument and have no return.
The `file_manager` argument is a sequence of `files`, which have 3 attributes
and some helper methods:
- `path`: the `pathlib.Path` where the file is on the file system.
- `addon`: the addon the file belongs to.
- `content`: the re-writtable content of the file (lazy).
- `print_progress(current, total)`: outputs the current progress.
.. example::
.. code-block:: python
def upgrade(file_manager):
files = (file for file in file_manager if file.path.suffix == '.py')
for fileno, file in enumerate(files, start=1):
file.content = file.content.replace(..., ...)
file_manager.print_progress(fileno, len(files))

View File

@@ -25,6 +25,9 @@ On top of technical data, business data can be defined, e.g. countries, currenci
as well as complete country localization (legal reports, tax definitions, chart of account), and much
more...
.. _tutorials/define_module_data/demo_data:
Demo Data
---------