From 9049311711e68baf4b9b07ab2d5b6d77be4d030e Mon Sep 17 00:00:00 2001 From: "Aurelien van Delft (avd)" Date: Tue, 22 Oct 2024 11:13:56 +0000 Subject: [PATCH] [ADD] tools: add populate cli documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes odoo/documentation#11266 X-original-commit: b0ede2819afc667f943676e6ea796fd81c28d498 Signed-off-by: Aurélien van Delft (avd) --- content/developer/reference/cli.rst | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/content/developer/reference/cli.rst b/content/developer/reference/cli.rst index c56b5aa2b..8150a4df6 100644 --- a/content/developer/reference/cli.rst +++ b/content/developer/reference/cli.rst @@ -7,7 +7,7 @@ Command-line interface (CLI) The CLI :dfn:`command-line interface` offers several functionalities related to Odoo. You can use it to :ref:`run the server `, :ref:`launch Odoo as a Python console environment `, :ref:`scaffold an Odoo module `, -or :ref:`count the number of lines of code `. +:ref:`populate a database ` or :ref:`count the number of lines of code `. .. important:: The command to use to call the CLI depends on how you installed Odoo. In the examples below, we @@ -739,6 +739,39 @@ Scaffolding is available via the :command:`odoo-bin scaffold` subcommand. This will create module *my_module* in directory */addons/*. +.. _reference/cmdline/populate: + +Database population +=================== + +.. program:: odoo-bin populate + +Odoo Populate allows to duplicate existing data in a given database. This can be used +for testing and benchmarking when large tables are needed. The duplication process +introduces variation for some fields to respect `UNIQUE` constraints, among other things. +It also follows x2Many relationships. + +.. code-block:: console + + $ odoo-bin populate -d my_database --models res.partner,account.move --factors 1000 + +.. option:: -d + + name of the database to populate + +.. option:: --models + + list of models to populate. Models appearing twice will only be populated once. + +.. option:: --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 + + separator used to generate record names + .. _reference/cmdline/cloc: Cloc