API Reference

This section provides an auto-generated API reference for the core components of the fluvo library.

Command-Line Interface (__main__)

This module contains the main click-based command-line interface.

fluvo

Fluvo: A tool for importing, exporting, and processing data.

Usage

fluvo [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

-v, --verbose

Enable verbose, debug-level logging.

--log-file <log_file>

Path to a file to write logs to, in addition to the console.

--flow-file <flow_file>

Path to the YAML flow file. Defaults to ‘flows.yml’ in current directory.

--run <flow_name>

Name of a specific flow to run from the flow file.

export

Runs the data export process.

Usage

fluvo export [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--protocol <protocol>

RPC protocol to use. Options: xmlrpc (default for Odoo 8-9), jsonrpc (recommended for Odoo 10-18, ~30%% faster), json2 (Odoo 19+, requires API key). If not specified, uses protocol from config file or defaults to xmlrpc.

Options:

xmlrpc | xmlrpcs | jsonrpc | jsonrpcs | json2 | json2s

--output <output>

Required Output file path.

--model <model>

Required Odoo model to export from.

--fields <fields>

Required Comma-separated list of fields to export. Special specifiers are available for IDs: ‘.id’ for raw database ID; ‘field/.id’ for related raw ID; ‘id’ for XML ID; ‘field/id’ for related XML ID. The tool automatically uses the best export method based on the fields requested.

--domain <domain>

Odoo domain filter as a list string.

--worker <worker>

Number of simultaneous connections.

--size <batch_size>

Number of records to process per batch.

--streaming

Enable streaming to write data batch-by-batch. Use for very large datasets.

--resume-session <resume_session>

Resume a previously failed export session using its ID.

-s, --sep <separator>

CSV separator character.

--context <context>

Odoo context as a dictionary string.

--encoding <encoding>

Encoding of the data file.

--technical-names

Force the use of the high-performance raw export mode. This is often enabled automatically if you request raw IDs or technical field types like ‘selection’ or ‘binary’.

--all-companies

Automatically set allowed_company_ids to all companies the user has access to. This enables exporting records across multiple companies.

--sudo

Temporarily disable record rules for the model during export. Requires admin rights. Use with –all-companies to export all records across companies regardless of restrictive record rules.

--sanitize-newlines <sanitize_newlines>

Replace embedded newlines in text fields with this string. Default: None (no sanitization). Recommended: “ | “ to prevent CSV corruption from embedded newlines in text/char/html fields.

import

Runs the data import process.

Usage

fluvo import [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--protocol <protocol>

RPC protocol to use. Options: xmlrpc (default for Odoo 8-9), jsonrpc (recommended for Odoo 10-18, ~30%% faster), json2 (Odoo 19+, requires API key). If not specified, uses protocol from config file or defaults to xmlrpc.

Options:

xmlrpc | xmlrpcs | jsonrpc | jsonrpcs | json2 | json2s

--file <filename>

Required File to import.

--model <model>

Odoo model to import into. If not provided, it’s inferred from the filename.

--deferred-fields <deferred_fields>

Comma-separated list of fields to defer to a second pass (enables two-pass import).

--auto-defer

Automatically defer all non-required many2one fields. Enables progressive import where records are created first, then relational fields are populated in Pass 2.

--unique-id-field <unique_id_field>

The column that uniquely identifies records (e.g., ‘xml_id’). Required for deferred imports.

--no-preflight-checks

Skip all pre-flight checks before starting the import.

--check-refs <check_refs>

Action for pre-import reference check: fail (abort if missing), warn (continue with warning), skip (no check). Default: warn.

Options:

fail | warn | skip

--worker <worker>

Number of simultaneous connections.

--size <batch_size>

Number of lines to import per connection.

--delay <batch_delay>

Delay in seconds between batches to reduce server load. Use 0.5-2.0 for busy servers. Default: 0 (no delay).

--max-batch-bytes <max_batch_bytes>

Maximum estimated payload size per batch in bytes. When a batch exceeds this size, it is split regardless of record count. Useful for imports with large binary fields like images. Default: 5242880 (5MB). Set to 0 to disable size-based batching.

--skip <skip>

Number of initial lines to skip.

--fail

Run in fail mode, retrying records from the _fail.csv file.

--headless

Run in headless mode, auto-confirming any prompts (e.g., installing languages).

-s, --sep <separator>

CSV separator character.

--groupby <groupby>

Comma-separated list of columns to group data by to prevent deadlocks.Records with empty values for the first column are processed first, then grouped by that column. This process repeats for subsequent columns.

--ignore <ignore>

Comma-separated list of columns to ignore.

--context <context>

Odoo context as a JSON string e.g., ‘{“key”: true}’.

--company-id <company_id>

Company ID or external ID for multicompany imports. Accepts database ID (e.g., ‘1’) or XML ID (e.g., ‘base.main_company’). Sets allowed_company_ids context to enable cross-company field references.

--all-companies

Automatically set allowed_company_ids to all companies the user has access to. This mimics the behavior of the Odoo web interface and enables importing records that reference data across multiple companies.

--o2m

Special handling for one-to-many imports.

--on-missing-ref <on_missing_ref>

Action for missing references: field:action pairs. Actions: create (auto-create), skip (skip row), empty (set to False). Example: ‘country_id:create,user_id:skip,category_id:empty’

--auto-create-refs

Automatically create missing related records for all many2one fields. Uses Odoo’s name_create to create records with just the name.

--set-empty-on-missing

Set relational fields to empty (False) when reference not found, instead of failing the row. Useful for capturing incomplete data.

--fallback-values <fallback_values>

Default values for invalid selection/boolean fields: field:value pairs. Example: ‘state:draft,active:true’

--tracking-disable, --tracking-enable

Disable/enable mail tracking during import. Disabled by default.

--auto-clean

Apply safe, type-aware coercions before load (strip whitespace, normalize null tokens, canonicalize booleans). Off by default.

--defer-parent-store

Defer parent_left/parent_right computation for hierarchical models. Improves performance for large imports of nested structures.

--encoding <encoding>

Encoding of the data file.

--stream

Stream CSV data without loading entire file into memory. Ideal for very large files. Not compatible with –o2m, –groupby, –defer, or –fail options.

--resume, --no-resume

Resume from checkpoint if available. Enabled by default. When enabled, imports can be resumed after crashes or interruptions.

--no-checkpoint

Disable checkpoint saving during import. Use for small imports where checkpointing overhead is not needed.

--dry-run

Validate data without importing. Checks required fields, selection values, and reference existence.

--skip-unchanged

Skip records that already exist with identical values. Makes imports idempotent by comparing field values before importing.

--skip-existing

Skip records whose external ID already exists in Odoo. Makes imports safely re-runnable without update errors. Ideal for stock.quant and other models with update restrictions.

--adaptive-throttle, --no-adaptive-throttle

Health-aware throttling that automatically adjusts batch sizes and delays based on server response times. Enabled by default to prevent server overload. Use –no-adaptive-throttle to disable for maximum speed.

--sudo

Temporarily disable record rules for the model during import. Requires admin rights. Use with –all-companies to import all records across companies regardless of restrictive record rules.

--post-action <post_action>

Method to call on imported records after successful import. Example: ‘action_apply_inventory’ for stock.quant to apply stock adjustments. The method is called with all successfully imported record IDs.

--move-date <move_date>

Set the date on stock moves created by inventory adjustment. Use with –post-action action_apply_inventory for opening inventory imports. Format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. Example: –move-date 2026-01-01

migrate

Performs a direct server-to-server data migration.

Usage

fluvo migrate [OPTIONS]

Options

--config-export <config_export>

Required Path to the source Odoo connection config.

--config-import <config_import>

Required Path to the destination Odoo connection config.

--model <model>

Required The Odoo model to migrate.

--domain <domain>

Domain filter to select records for export.

--fields <fields>

Required Comma-separated list of fields to migrate.

--mapping <mapping>

A dictionary string defining the transformation mapping.

--export-worker <export_worker>

Number of workers for the export phase.

--export-batch-size <export_batch_size>

Batch size for the export phase.

--import-worker <import_worker>

Number of workers for the import phase.

--import-batch-size <import_batch_size>

Batch size for the import phase.

module

Commands for managing Odoo modules.

Usage

fluvo module [OPTIONS] COMMAND [ARGS]...
install

Installs or upgrades a list of Odoo modules.

Usage

fluvo module install [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

-m, --modules <modules_str>

Required A comma-separated list of module names to install or upgrade.

install-languages

Installs one or more languages in the Odoo database.

Usage

fluvo module install-languages [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

-l, --languages <languages_str>

Required A comma-separated list of language codes to install (e.g., ‘nl_BE,fr_FR’).

uninstall

Uninstalls a list of Odoo modules.

Usage

fluvo module uninstall [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

-m, --modules <modules_str>

Required A comma-separated list of module names to uninstall.

update-list

Scans the addons path and updates the list of available modules.

Usage

fluvo module update-list [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

path-to-image

Converts columns with local file paths into base64 strings.

Usage

fluvo path-to-image [OPTIONS] FILE

Options

-f, --fields <fields>

Required Comma-separated list of fields to export. Special specifiers are available for IDs: ‘.id’ for the raw database ID of the record. ‘field/.id’ for the raw database ID of a related record. ‘id’ for the XML/External ID of the record. ‘field/id’ for the XML/External ID of a related record. Using ‘.id’ or ‘/.id’ will automatically enable a faster, raw export mode.

--path <path>

Image path prefix. Defaults to the current working directory.

--out <out>

Name of the resulting output file.

Arguments

FILE

Required argument

url-to-image

Downloads content from URLs in columns and converts to base64.

Usage

fluvo url-to-image [OPTIONS] FILE

Options

-f, --fields <fields>

Required Comma-separated list of fields with URLs to convert to base64.

--out <out>

Name of the resulting output file.

Arguments

FILE

Required argument

vat

Commands for managing VAT/VIES validation settings.

Usage

fluvo vat [OPTIONS] COMMAND [ARGS]...
disable

Disable VAT validation (VIES and/or stdnum) for companies.

Usage

fluvo vat disable [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--company-ids <company_ids>

Comma-separated list of company IDs. If not specified, disables for all.

--vies, --no-vies

Disable VIES online check. Default: True.

--stdnum, --no-stdnum

Disable stdnum format validation. Default: True.

--save-settings

Save current settings for later restoration. Default: True.

--output <output>

Save settings to a JSON file for later restoration.

get-settings

Get current VAT validation settings for all companies.

Usage

fluvo vat get-settings [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--company-ids <company_ids>

Comma-separated list of company IDs to check. If not specified, checks all.

--include-stdnum, --no-stdnum

Include stdnum validation settings. Default: True.

restore

Restore VAT validation settings to their original state.

Usage

fluvo vat restore [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--input <input_file>

Restore settings from a JSON file saved by ‘vat disable –output’.

validate

Validate VAT numbers against VIES in batches with optional notifications.

Usage

fluvo vat validate [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--batch-size <batch_size>

Number of records to validate per batch. Default: 50.

--delay <delay>

Delay between batches in seconds. Default: 1.0.

--notify-users <notify_users>

Comma-separated list of user IDs to notify on failures.

--domain <domain>

Odoo domain filter as a list string. Example: “[(‘is_company’, ‘=’, True)]”

--max-records <max_records>

Maximum number of records to validate.

workflow

Run legacy or complex post-import processing workflows.

Usage

fluvo workflow [OPTIONS] COMMAND [ARGS]...
invoice-v9

Runs the legacy Odoo v9 invoice processing workflow.

Usage

fluvo workflow invoice-v9 [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--action <actions>

Workflow action to run. Can be specified multiple times. Defaults to ‘all’.

Options:

tax | validate | pay | proforma | rename | all

--field <field>

Required The source field containing the legacy invoice status.

--status-map <status_map_str>

Required Dictionary string mapping Odoo states to legacy states. e.g., “{‘open’: [‘OP’]}”

--paid-date-field <paid_date_field>

Required The source field containing the payment date.

--payment-journal <payment_journal>

Required The database ID of the payment journal.

--max-connection <max_connection>

Number of parallel threads.

write

Runs the batch update (write) process.

Usage

fluvo write [OPTIONS]

Options

--connection-file <connection_file>

Required Path to the Odoo connection file.

--file <filename>

Required File with records to update.

--model <model>

Required Odoo model to write to.

--worker <worker>

Number of simultaneous connections.

--size <batch_size>

Number of records to process per batch.

--fail

Run in fail mode, retrying records from the _write_fail.csv file.

-s, --sep <separator>

CSV separator character.

--context <context>

Odoo context as a dictionary string.

--encoding <encoding>

Encoding of the data file.

Transformation Processor (lib.transform)

This module contains the main Processor class used for data transformation.

This module contains the core Processor class for transforming data.

class fluvo.lib.transform.Processor(mapping, source_filename=None, dataframe=None, connection=None, model=None, config_file=None, separator=';', preprocess=<function Processor.<lambda>>, schema_overrides=None, date_formats=None, datetime_formats=None, **kwargs)

Core class for reading, transforming, and preparing data for Odoo.

Parameters:
  • mapping (Mapping[str, Any])

  • source_filename (str | None)

  • dataframe (DataFrame | None)

  • connection (Any | None)

  • model (str | None)

  • config_file (str | None)

  • separator (str)

  • preprocess (Callable[[DataFrame], DataFrame])

  • schema_overrides (dict[str, DataType] | None)

  • date_formats (dict[str, str] | None)

  • datetime_formats (dict[str, str] | None)

  • kwargs (Any)

check(check_fun, message=None)

Runs a data quality check function against the loaded data.

Parameters:
  • check_fun (Callable[[...], bool]) – The checker function to execute.

  • message (str | None) – An optional custom error message to display on failure.

Returns:

True if the check passes, False otherwise.

Return type:

bool

split(split_fun)

Splits the processor’s data into multiple new Processor objects.

Parameters:

split_fun (Callable[[...], Any]) – A function that takes a row dictionary and index, and returns a key to group the row by.

Returns:

A dictionary where keys are the grouping keys and values are new Processor instances containing the grouped data.

Return type:

dict[Any, Processor]

get_o2o_mapping()

Generates a direct 1-to-1 mapping dictionary.

Return type:

dict[str, MapperRepr]

process(filename_out, params=None, t='list', null_values=None, m2m=False, m2m_columns=None, dry_run=False)

Processes the data using a mapping and prepares it for writing.

Parameters:
  • mapping – The mapping dictionary defining the transformation rules.

  • filename_out (str) – The path where the output CSV file will be saved.

  • params (dict[str, Any] | None) – A dictionary of parameters for the fluvo import command, used when generating the load script.

  • t (str) – The type of collection to return data in (‘list’ or ‘set’).

  • null_values (list[Any] | None) – A list of values to be treated as empty.

  • m2m (bool) – If True, activates special processing for many-to-many data.

  • m2m_columns (list[str] | None) – A list of column names to unpivot when m2m=True.

  • dry_run (bool) – If True, prints a sample of the output to the console instead of writing files.

Returns:

A Dataframe containing the header list and the transformed data.

Return type:

DataFrame

process_m2m(id_column, m2m_columns, filename_out, params=None, separator=',')

Processes many-to-many data by first unpivoting the source data.

This is a robust alternative to using the m2m=True flag. It unnests comma-separated values from the ‘m2m_columns’ into individual rows before processing.

Parameters:
  • id_column (str) – The column to use as the stable ID (e.g., ‘id’ or ‘ref’).

  • m2m_columns (list[str]) – A list of columns that contain the m2m values.

  • filename_out (str) – The path where the output CSV file will be saved.

  • params (dict[str, Any] | None) – A dictionary of parameters for the fluvo import command.

  • separator (str) – The separator for the values within the m2m columns.

Return type:

None

write_to_file(script_filename, fail=True, append=False, python_exe='python', path='')

Generates the .sh script for the import.

Parameters:
  • script_filename (str) – The path where the shell script will be saved.

  • fail (bool) – If True, includes a second command with the –fail flag.

  • append (bool) – If True, appends to the script file instead of overwriting.

  • python_exe (str) – The python executable to use in the script.

  • path (str) – The path to prepend to the fluvo command.

Return type:

None

join_file(filename, master_key, child_key, header_prefix='child', separator=';', schema_overrides=None, dry_run=False)

Joins data from a secondary file into the processor’s main data.

Parameters:
  • filename (str) – The path to the secondary file to join.

  • master_key (str) – The column name in the main data to join on.

  • child_key (str) – The column name in the secondary data to join on.

  • header_prefix (str) – A prefix to add to the headers from the child file.

  • separator (str) – The column separator for the child CSV file.

  • schema_overrides (dict[str, DataType] | None) – A dictionary to override Polars’ inferred data types for the joined file.

  • dry_run (bool) – If True, prints a sample of the joined data to the console without modifying the processor’s state.

Return type:

None

resolve_relation(source_column, model, key_field, relation_field, to='xmlid', multi=False, sep=',', on_missing='keep', drop_source=False)

Pre-resolve a relation column to external/db IDs in Polars.

Joins source_column (natural keys like a country name/code) against a cached id-map of model and adds a <relation_field>/id (xmlid) or <relation_field>/.id (db id) column, so Odoo’s load() performs no name_search for that field. Mappings stay in Python: call this in your transform script, then map the produced <relation_field>/id column.

Parameters:
  • source_column (str) – Column in the source data holding the natural key.

  • model (str) – The related Odoo model (e.g. res.country).

  • key_field (str) – Natural-key field on that model (e.g. name, code).

  • relation_field (str) – The target Odoo m2o/m2m field (e.g. country_id).

  • to (str) – "xmlid" (default, portable) or "dbid" (fastest, DB-specific).

  • multi (bool) – True for many2many (split/resolve/rejoin by sep).

  • sep (str) – Separator for many2many values (default ,).

  • on_missing (str) – "keep" (leave unresolved) or "error" (raise).

  • drop_source (bool) – Drop source_column after resolving.

Return type:

None

Mapper Functions (lib.mapper)

This module contains all the built-in mapper functions for data transformation. These are row-by-row functions that work with Python dictionaries.

This module contains a library of mapper functions.

Mappers are the core building blocks for data transformations. Each function in this module is a “mapper factory” - it is a function that you call to configure and return another function, which will then be executed by the Processor for each row of the source data.

fluvo.lib.mapper.binary(field, path_prefix='', skip=False)

Returns a mapper that converts a local file to a base64 string.

Parameters:
  • field (str) – The source column containing the path to the file.

  • path_prefix (str) – An optional prefix to prepend to the file path.

  • skip (bool) – If True, raises SkippingError if the file is not found.

Returns:

A mapper function that returns the base64 encoded string.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.binary_url_map(field, skip=False)

Deprecated url mapper.

Parameters:
  • field (str)

  • skip (bool)

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.binary_url_to_base64(field, skip_on_fail=False)

Returns a mapper that downloads a file from a URL and converts to base64.

Parameters:
  • field (str) – The source column containing the URL.

  • skip_on_fail (bool) – If True, raises SkippingError if the URL cannot be fetched.

Returns:

A mapper function that returns the base64 encoded string, an empty string, or None, depending on the failure mode.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.bool_val(field, true_values=None, false_values=None, default=False)

Returns a mapper that converts a field value to a boolean ‘1’ or ‘0’.

The logic is as follows:

  1. If true_values is provided, any value in that list is considered True.

  2. If false_values is provided, any value in that list is considered False.

  3. If the value is not in either list, the truthiness of the value itself is used, unless default is set.

  4. If no lists are provided, the truthiness of the value is used.

Parameters:
  • field (str) – The source column to check.

  • true_values (list[str] | None) – A list of strings that should be considered True.

  • false_values (list[str] | None) – A list of strings that should be considered False.

  • default (bool) – The default boolean value to return if no other condition is met.

Returns:

A mapper function that returns “1” or “0”.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.concat(separator, *fields, skip=False)

Returns a mapper that joins values from multiple fields or static strings.

Parameters:
  • separator (str) – The string to place between each value.

  • *fields (Any) – A variable number of source column names or static strings.

  • skip (bool) – If True, raises SkippingError if the final result is empty.

Returns:

A mapper function that returns the concatenated string.

Return type:

MapperFunc

fluvo.lib.mapper.concat_field_value_m2m(separator, *fields)

(Legacy V9-V12) Specialized concat for attribute value IDs.

Joins each field name with its value (e.g., ‘Color’ + ‘Blue’ -> ‘Color_Blue’), then joins all resulting parts with a comma. This was used to create unique external IDs for product.attribute.value records.

Parameters:
  • separator (str) – The character to join the field name and value with.

  • *fields (str) – The attribute columns to process.

Returns:

A mapper function that returns the concatenated string.

Return type:

MapperFunc

fluvo.lib.mapper.concat_mapper_all(separator, *fields)

Returns a mapper that joins values, but only if all values exist.

If any of the values from the specified fields is empty, this mapper returns an empty string.

Parameters:
  • separator (str) – The string to place between each value.

  • *fields (Any) – A variable number of source column names or static strings.

Returns:

A mapper function that returns the concatenated string or an empty string.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.cond(field, true_mapper, false_mapper)

Returns a mapper that applies one of two mappers based on a condition.

Parameters:
  • field (str) – The source column to check for a truthy value.

  • true_mapper (Any) – The mapper to apply if the value in field is truthy.

  • false_mapper (Any) – The mapper to apply if the value in field is falsy.

Returns:

A mapper function that returns the result of the chosen mapper.

Return type:

MapperFunc

fluvo.lib.mapper.const(value)

Returns a mapper that always provides a constant value.

Parameters:

value (Any)

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.field(col)

Returns the column name itself if the column has a value.

This is useful for some dynamic product attribute mappings.

Parameters:

col (str) – The name of the column to check.

Returns:

A mapper function that returns the column name or an empty string.

Return type:

MapperFunc

fluvo.lib.mapper.m2m(prefix, *fields, sep=',', default='')

Returns a mapper that creates a comma-separated list of Many2many external IDs.

It processes values from specified source columns, splitting them by ‘sep’ if they contain the separator, and applies the prefix to each resulting ID.

Parameters:
  • prefix (str) – The XML ID prefix to apply to each value.

  • *fields (Any) – One or more source column names from which to get values.

  • sep (str) – The separator to use when splitting values within a single field.

  • default (str) – The value to return if no IDs are generated.

Returns:

A mapper function that returns a comma-separated string of external IDs.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.m2m_attribute_value(prefix, *fields)

(Legacy V9-V12) Creates a list of external IDs for attribute values.

This is a composite mapper for the legacy product attribute workflow.

Parameters:
  • prefix (str) – The XML ID prefix.

  • *fields (str) – The attribute columns to process.

Returns:

A mapper that returns a comma-separated string of external IDs.

Return type:

MapperFunc

fluvo.lib.mapper.m2m_id_list(prefix, *args, sep=',', const_values=None)

Returns a mapper for creating a list of M2M external IDs.

This function can take either raw field names (str) or other mapper functions as its arguments. It processes each argument to produce an individual ID. If a field’s value contains the separator, it will be split.

Parameters:
  • prefix (str)

  • args (Any)

  • sep (str)

  • const_values (list[str] | None)

Return type:

Callable[[dict[str, Any], dict[str, Any]], list[str]]

fluvo.lib.mapper.m2m_map(prefix, mapper_func)

Returns a mapper that wraps another mapper for Many2many fields.

It takes the comma-separated string result of another mapper and applies the to_m2m formatting to it.

Parameters:
  • prefix (str) – The XML ID prefix to apply.

  • mapper_func (Callable[[dict[str, Any], dict[str, Any]], Any]) – The inner mapper function to execute first.

Returns:

A mapper function that returns a formatted m2m external ID list.

Return type:

MapperFunc

fluvo.lib.mapper.m2m_template_attribute_value(prefix, *fields)

(Modern V13+) Creates a comma-separated list of attribute values.

This mapper concatenates the values of the given fields. This is used for the modern product attribute system where Odoo automatically creates the product.attribute.value records from the raw value names.

It will return an empty string if the template_id is missing from the source line, preventing the creation of orphaned attribute lines.

Parameters:
  • prefix (str) – (Unused) Kept for backward compatibility.

  • *fields (Any) – The attribute columns (e.g. ‘Color’, ‘Size’) to get values from.

Returns:

A mapper that returns a comma-separated string of attribute values.

Return type:

MapperFunc

fluvo.lib.mapper.m2m_value_list(*args, sep=',', const_values=None)

Returns a mapper that creates a Python list of unique raw values.

It processes each argument to produce an individual raw value. If a field’s value contains the separator, it will be split.

Parameters:
  • args (Any)

  • sep (str)

  • const_values (list[str] | None)

Return type:

Callable[[dict[str, Any], dict[str, Any]], list[str]]

fluvo.lib.mapper.m2o(prefix, field, default='', skip=False)

Returns a mapper that creates a Many2one external ID from a field’s value.

Parameters:
  • prefix (str) – The XML ID prefix (e.g., ‘my_module’).

  • field (str) – The source column containing the value for the ID.

  • default (str) – The value to return if the source value is empty.

  • skip (bool) – If True, raises SkippingError if the source value is empty.

Returns:

A mapper function that returns the formatted external ID.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.m2o_att(prefix, att_list)

(Legacy V9-V12) Returns a dictionary of attribute-to-ID mappings.

This is a helper for legacy product attribute workflows where IDs for attribute values were manually constructed.

Parameters:
  • prefix (str) – The XML ID prefix to use for the attribute value IDs.

  • att_list (list[str]) – A list of attribute column names to process.

Returns:

A mapper function that returns a dictionary.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.m2o_att_name(prefix, att_list)

Returns a mapper that creates a dictionary of attribute-to-ID mappings.

This is used in legacy product import workflows.

Parameters:
  • prefix (str) – The XML ID prefix to use for the attribute IDs.

  • att_list (list[str]) – A list of attribute column names to check for.

Returns:

A mapper function that returns a dictionary.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.m2o_map(prefix, *fields, default='', skip=False)

Returns a mapper that creates a Many2one external ID by concatenating fields.

This is useful when the unique identifier for a record is spread across multiple columns.

Parameters:
  • prefix (str) – The XML ID prefix (e.g., ‘my_module’).

  • *fields (Any) – A variable number of source column names or static strings to join.

  • default (str) – The value to return if the final concatenated value is empty.

  • skip (bool) – If True, raises SkippingError if the final result is empty.

Returns:

A mapper function that returns the formatted external ID.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.map_val(mapping_dict, key_mapper, default='', m2m=False)

Returns a mapper that translates a value using a provided dictionary.

Parameters:
  • mapping_dict (dict[Any, Any]) – The dictionary to use as a translation table.

  • key_mapper (Any) – A mapper that provides the key to look up.

  • default (Any) – A default value to return if the key is not found.

  • m2m (bool) – If True, splits the key by commas and translates each part.

Returns:

A mapper function that returns the translated value.

Return type:

MapperFunc

fluvo.lib.mapper.num(field, default=None)

Creates a mapper that converts a value to a native integer or float.

This function is a factory that generates a mapper function. The returned mapper attempts to robustly parse a value from a source dictionary key into a numeric type. It handles values that are already numbers, numeric strings (with or without commas), or empty/null.

Parameters:
  • field (str) – The key or column name to retrieve the value from in a source dictionary.

  • default (Any, optional) – The value to return if the source value is empty, null, or cannot be converted to a number. Defaults to None.

Returns:

A mapper function that takes a

dictionary-like row and returns the converted numeric value (int or float) or the default.

Return type:

Callable[…, Optional[Union[int, float]]]

fluvo.lib.mapper.record(mapping)

Returns a mapper that processes a sub-mapping for a related record.

Used for creating one-to-many records (e.g., sales order lines).

Parameters:

mapping (dict[str, Callable[[dict[str, Any], dict[str, Any]], Any]]) – A mapping dictionary for the related record.

Returns:

A mapper function that returns a dictionary of the processed sub-record.

Return type:

MapperFunc

fluvo.lib.mapper.split_file_number(file_nb)

Returns a function to split data across a fixed number of chunks.

Parameters:

file_nb (int) – The total number of chunks to create.

Returns:

A function compatible with the Processor.split method.

Return type:

Callable[[dict[str, Any], int], int]

fluvo.lib.mapper.split_line_number(line_nb)

Returns a function to split data into chunks of a specific line count.

Parameters:

line_nb (int) – The number of lines per chunk.

Returns:

A function compatible with the Processor.split method.

Return type:

Callable[[dict[str, Any], int], int]

fluvo.lib.mapper.to_m2m(prefix, value)

Creates a comma-separated list of external IDs .

Creates a comma-separated list of external IDs for a Many2many relationship. It takes a string of comma-separated values, sanitizes each one, and prepends the prefix.

Parameters:
  • prefix (str) – The XML ID prefix to apply to each value.

  • value (str) – A single string containing one or more values,

  • commas. (separated by)

Returns:

A comma-separated string of formatted external IDs.

Return type:

str

fluvo.lib.mapper.to_m2o(prefix, value, default='')

Creates a full external ID for a Many2one relationship.

Creates a full external ID for a Many2one relationship by combining a prefix and a sanitized value.

Parameters:
  • prefix (str) – The XML ID prefix (e.g., ‘my_module’).

  • value (Any) – The value to be sanitized and appended to the prefix.

  • default (str) – The value to return if the input value is empty.

Returns:

The formatted external ID (e.g., ‘my_module.sanitized_value’).

Return type:

str

fluvo.lib.mapper.val(field, default=None, postprocess=<function <lambda>>, skip=False)

Returns a mapper that gets a value from a specific field in the row.

Parameters:
  • field (str)

  • default (Any)

  • postprocess (Callable[[...], Any])

  • skip (bool)

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

fluvo.lib.mapper.val_att(att_list)

(Legacy V9-V12) Returns a dictionary of attributes that have a value.

This is a helper for legacy product attribute workflows.

Parameters:

att_list (list[str]) – A list of attribute column names to check.

Returns:

A mapper function that returns a dictionary.

Return type:

Callable[[dict[str, Any], dict[str, Any]], Any]

Expression-Based Mappers (lib.expr)

This module provides high-performance Polars expression-based mappers. These return pl.Expr objects that leverage Polars’ vectorized execution engine for 10-100x speedups compared to the row-by-row mapper functions.

Polars expression-based mappers for high-performance data transformations.

This module provides Polars-native equivalents of the row-by-row mapper functions in the mapper module. These functions return pl.Expr objects that are executed as vectorized operations, providing significant performance improvements over row-by-row Python execution.

Usage:

from fluvo.lib import expr

processor = Processor(
mapping={

“name”: expr.val(“source_name”), “full_name”: expr.concat(” “, “first_name”, “last_name”), “price”: expr.num(“price_str”), “is_active”: expr.bool_val(“status”, true_values=[“active”, “yes”]),

}, dataframe=df,

)

Performance Note:

These expression-based functions are typically 10-100x faster than their mapper module equivalents because they leverage Polars’ vectorized execution engine instead of row-by-row Python iteration.

fluvo.lib.expr.bool_val(field, true_values=None, false_values=None, default=False)

Returns a Polars expression that converts a field to boolean “1” or “0”.

This is the Polars-native equivalent of mapper.bool_val().

Parameters:
  • field (str) – The source column to check.

  • true_values (list[str] | None) – Values that should be considered True.

  • false_values (list[str] | None) – Values that should be considered False.

  • default (bool) – Default boolean value if no match.

Returns:

A Polars expression returning “1” or “0”.

Return type:

Expr

fluvo.lib.expr.coalesce(*fields)

Returns a Polars expression that returns the first non-null value.

Parameters:

*fields (str) – Column names to check in order.

Returns:

A Polars expression returning the first non-null value.

Return type:

Expr

fluvo.lib.expr.concat(separator, *fields)

Returns a Polars expression that concatenates multiple columns.

This is the Polars-native equivalent of mapper.concat().

Parameters:
  • separator (str) – The string to place between each value.

  • *fields (str) – Column names to concatenate.

Returns:

A Polars expression that concatenates the columns.

Return type:

Expr

fluvo.lib.expr.concat_all(separator, *fields)

Returns a Polars expression that concatenates columns only if all have values.

If any column is null or empty, returns an empty string. This is the Polars-native equivalent of mapper.concat_mapper_all().

Parameters:
  • separator (str) – The string to place between each value.

  • *fields (str) – Column names to concatenate.

Returns:

A Polars expression.

Return type:

Expr

fluvo.lib.expr.cond(field, true_value, false_value)

Returns a Polars expression that applies conditional logic.

This is the Polars-native equivalent of mapper.cond().

Parameters:
  • field (str) – The source column to check for a truthy value.

  • true_value (str | Expr) – Value/expression to use if condition is true. If string, treated as a column name.

  • false_value (str | Expr) – Value/expression to use if condition is false. If string, treated as a column name.

Returns:

A Polars expression.

Return type:

Expr

fluvo.lib.expr.const(value)

Returns a Polars expression that always provides a constant value.

This is the Polars-native equivalent of mapper.const().

Parameters:

value (Any) – The constant value to return.

Returns:

A Polars literal expression.

Return type:

Expr

fluvo.lib.expr.date(field, format)

Returns a Polars expression that parses a date with a custom format.

This provides the same functionality as the Processor’s date_formats parameter but as an expression that can be used in mappings.

Parameters:
  • field (str) – The source column name.

  • format (str) – The strftime format string (e.g., “%d/%m/%Y”).

Returns:

A Polars expression returning a Date.

Return type:

Expr

fluvo.lib.expr.datetime(field, format)

Returns a Polars expression that parses a datetime with a custom format.

Parameters:
  • field (str) – The source column name.

  • format (str) – The strftime format string (e.g., “%d/%m/%Y %H:%M:%S”).

Returns:

A Polars expression returning a Datetime.

Return type:

Expr

fluvo.lib.expr.m2m(prefix, field, separator=',', default='')

Returns a Polars expression that creates Many2many external IDs.

Splits the field value by separator and creates external IDs for each part. This is the Polars-native equivalent of mapper.m2m().

Parameters:
  • prefix (str) – The XML ID prefix.

  • field (str) – The source column containing comma-separated values.

  • separator (str) – The separator used in the source data.

  • default (str) – Value to return if source is empty.

Returns:

A Polars expression returning comma-separated external IDs.

Return type:

Expr

fluvo.lib.expr.m2o(prefix, field, default='')

Returns a Polars expression that creates a Many2one external ID.

This is the Polars-native equivalent of mapper.m2o().

Parameters:
  • prefix (str) – The XML ID prefix (e.g., ‘my_module’).

  • field (str) – The source column containing the value for the ID.

  • default (str) – Value to return if source is empty.

Returns:

A Polars expression returning the formatted external ID.

Return type:

Expr

fluvo.lib.expr.map_val(field, mapping_dict, default=None)

Returns a Polars expression that translates values using a dictionary.

This is the Polars-native equivalent of mapper.map_val().

Parameters:
  • field (str) – The source column name.

  • mapping_dict (dict[Any, Any]) – Dictionary mapping source values to target values.

  • default (Any) – Default value if key is not found. If None, keeps original value.

Returns:

A Polars expression.

Return type:

Expr

fluvo.lib.expr.num(field, default=None, decimal_separator=',')

Returns a Polars expression that converts a field to a number.

Handles European-style numbers with comma as decimal separator. This is the Polars-native equivalent of mapper.num().

Parameters:
  • field (str) – The source column name.

  • default (int | float | None) – Default value if conversion fails.

  • decimal_separator (str) – The decimal separator in the source data.

Returns:

A Polars expression returning a float.

Return type:

Expr

fluvo.lib.expr.val(field, default=None)

Returns a Polars expression that gets a value from a column.

This is the Polars-native equivalent of mapper.val().

Parameters:
  • field (str) – The source column name.

  • default (Any) – The default value to use if the column value is null.

Returns:

A Polars expression.

Return type:

Expr

High-Level Runners

These modules contain the high-level functions that are called by the CLI commands.

Importer (importer)

Main importer module.

This module contains the high-level logic for orchestrating the import process. It handles file I/O, pre-flight checks, and the delegation of the core import tasks to the multi-threaded import_threaded module.

fluvo.importer.run_import(config, filename, model, deferred_fields, auto_defer, unique_id_field, no_preflight_checks, headless, worker, batch_size, skip, fail, separator, ignore, context, encoding, o2m, groupby, auto_create_refs=False, set_empty_on_missing=False, batch_delay=0.0, stream=False, resume=True, no_checkpoint=False, check_refs='warn', skip_unchanged=False, skip_existing=False, adaptive_throttle=True, max_batch_bytes=5242880, resolve_relations=None, auto_clean=False)

Main entry point for the import command, handling all orchestration.

Returns:

Mapping of external IDs to database IDs for all

successfully imported records, or None if the import failed.

Return type:

dict[str, int]

Parameters:
  • config (str | dict[str, Any])

  • filename (str)

  • model (str | None)

  • deferred_fields (list[str] | None)

  • auto_defer (bool)

  • unique_id_field (str | None)

  • no_preflight_checks (bool)

  • headless (bool)

  • worker (int)

  • batch_size (int)

  • skip (int)

  • fail (bool)

  • separator (str)

  • ignore (list[str] | None)

  • context (Any)

  • encoding (str)

  • o2m (bool)

  • groupby (list[str] | None)

  • auto_create_refs (bool)

  • set_empty_on_missing (bool)

  • batch_delay (float)

  • stream (bool)

  • resume (bool)

  • no_checkpoint (bool)

  • check_refs (str)

  • skip_unchanged (bool)

  • skip_existing (bool)

  • adaptive_throttle (bool)

  • max_batch_bytes (int)

  • resolve_relations (list[dict[str, Any]] | None)

  • auto_clean (bool)

Exporter (exporter)

This module contains the high-level logic for exporting data from Odoo.

fluvo.exporter.run_export(config, model, fields, output, domain='[]', worker=1, batch_size=1000, context='{}', separator=';', encoding='utf-8', technical_names=False, streaming=False, resume_session=None, sanitize_newlines=None)

Orchestrates the data export process.

Parameters:
  • sanitize_newlines (str | None) – If provided, replace embedded newlines in text fields with this string (e.g., “ | “). Prevents CSV corruption.

  • config (str | dict[str, Any])

  • model (str)

  • fields (str)

  • output (str | None)

  • domain (str)

  • worker (int)

  • batch_size (int)

  • context (str | dict[str, Any])

  • separator (str)

  • encoding (str)

  • technical_names (bool)

  • streaming (bool)

  • resume_session (str | None)

Return type:

None

Migrator (migrator)

Migrate data between two odoo databases.

This module contains the logic for performing a direct, in-memory migration of data from one Odoo instance to another.

fluvo.migrator.run_migration(config_export, config_import, model, domain='[]', fields=None, mapping=None, export_worker=1, export_batch_size=100, import_worker=1, import_batch_size=10)

Performs a server-to-server data migration.

This function chains together the export, transform, and import processes without creating intermediate files.

Parameters:
  • config_export (str)

  • config_import (str)

  • model (str)

  • domain (str)

  • fields (list[str] | None)

  • mapping (Mapping[str, Callable[[...], Any]] | None)

  • export_worker (int)

  • export_batch_size (int)

  • import_worker (int)

  • import_batch_size (int)

Return type:

None

Actions

These modules contain action functions for managing Odoo server state.

VIES/VAT Manager (lib.actions.vies_manager)

This module provides functions for managing VAT validation settings during imports.

VIES (VAT Information Exchange System) and VAT validation management.

This module provides actions for managing VAT validation settings during imports and for batch VAT validation with notifications.

Odoo has two levels of VAT validation: 1. stdnum validation - Local format check using Python’s stdnum library 2. VIES validation - Online EU VIES service check

During large contact imports, both can cause issues: - stdnum is CPU-intensive for large imports (Python performance) - VIES causes API timeouts with many contacts

This module allows: - Temporarily disabling VIES checks during import - Temporarily disabling stdnum validation during import - Restoring original settings after import - Batch validation of VAT numbers with notifications - Local VAT validation (can be replaced with Rust implementation for speed)

File-based Backup for Settings Recovery

VAT validation settings are backed up to a JSON file before being disabled. This ensures that if restoration fails (e.g., due to a 503 error), the original settings are preserved and will be used on the next import run.

Backup location: ~/.fluvo/vat_settings_backup/

Each database has its own backup file: vat_settings_{host}_{database}.json

Automatic recovery: If a backup file exists when starting a new import, it indicates that a previous restoration failed. The import will use the backed-up settings instead of polling the database (which may have incorrect “disabled” values).

Manual restoration: If you notice VAT validation is stuck in “disabled” state, you can manually restore settings:

from fluvo.lib.actions.vies_manager import (
    restore_vat_settings_from_backup,
    check_vat_settings_backup_status,
)

# Check if a backup exists
status = check_vat_settings_backup_status("odoo.conf")
if status["exists"]:
    print(f"Backup found, age: {status['age_hours']:.1f} hours")
    print(f"Companies: {status['vies_company_count']}")

    # Restore settings from backup
    success = restore_vat_settings_from_backup("odoo.conf")
    if success:
        print("Settings restored successfully")

Retry mechanism: Restoration automatically retries up to 5 times with exponential backoff (2s, 4s, 8s, 16s, 32s) for transient errors like 503 Service Unavailable, connection timeouts, etc.

For high-performance VAT validation, consider using a Rust-based validator: - The vat_validator crate provides fast EU VAT validation - Can be integrated via PyO3 bindings for Python interop - See: https://crates.io/crates/vat

fluvo.lib.actions.vies_manager.validate_vat_format(vat)

Validate VAT number format locally (no network call).

This is a fast, regex-based validation that checks the format of EU VAT numbers. It does NOT verify the VAT is actually valid with tax authorities - use VIES for that.

This function can be replaced with a Rust-based validator for better performance on large datasets.

Parameters:

vat (str) – The VAT number to validate (with country prefix).

Returns:

Tuple of (is_valid, error_message).

Return type:

tuple[bool, str | None]

fluvo.lib.actions.vies_manager.set_custom_vat_validator(validator)

Set a custom VAT validator function.

This allows replacing the default Python validation with a faster implementation (e.g., Rust-based via PyO3).

Parameters:

validator (Callable[[str], tuple[bool, str | None]] | None) – A function that takes a VAT string and returns (is_valid, error_message). Set to None to use default.

Return type:

None

Example with Rust validator:

from vat_validator import validate_eu_vat # hypothetical Rust binding

def rust_validator(vat: str) -> tuple[bool, Optional[str]]:
try:

result = validate_eu_vat(vat) return result.is_valid, result.error

except Exception as e:

return False, str(e)

set_custom_vat_validator(rust_validator)

fluvo.lib.actions.vies_manager.validate_vat_local(vat, check_format=True, check_checksum=True)

Validate a VAT number locally without network calls.

Uses either the custom validator (if set) or the built-in format and checksum validation.

Parameters:
  • vat (str) – The VAT number to validate.

  • check_format (bool) – Whether to check the format.

  • check_checksum (bool) – Whether to check the checksum.

Returns:

Tuple of (is_valid, error_message).

Return type:

tuple[bool, str | None]

fluvo.lib.actions.vies_manager.get_vat_validation_settings(config, company_ids=None, include_stdnum=True)

Get current VAT validation settings for all or specified companies.

Parameters:
  • config (str | dict[str, Any]) – Path to connection config file or config dict.

  • company_ids (list[int] | None) – Optional list of company IDs to check. If None, checks all.

  • include_stdnum (bool) – Whether to also retrieve stdnum validation settings.

Returns:

VatValidationSettings object with current settings, or None on error.

Return type:

VatValidationSettings | None

fluvo.lib.actions.vies_manager.disable_vat_validation(config, company_ids=None, disable_vies=True, disable_stdnum=True, save_settings=True, backup_dir=None)

Disable VAT validation (VIES and/or stdnum) for all or specified companies.

Uses file-based backup to preserve original settings across runs. If a previous restoration failed (backup file exists), the original settings are loaded from the backup file instead of polling the database (which may have incorrect values).

Parameters:
  • config (str | dict[str, Any]) – Path to connection config file or config dict.

  • company_ids (list[int] | None) – Optional list of company IDs. If None, disables for all.

  • disable_vies (bool) – Whether to disable VIES online check.

  • disable_stdnum (bool) – Whether to disable stdnum format validation.

  • save_settings (bool) – If True, returns the original settings for later restore.

  • backup_dir (Path | None) – Optional custom backup directory for settings file.

Returns:

VatValidationSettings with original settings if save_settings=True, else None.

Return type:

VatValidationSettings | None

fluvo.lib.actions.vies_manager.restore_vat_validation_settings(config, settings, backup_dir=None, max_retries=5, initial_delay=2.0, max_delay=60.0)

Restore VAT validation settings to their original state.

Includes automatic retries with exponential backoff for transient errors (503 Service Unavailable, connection issues, etc.). On successful restoration, the backup file is deleted. On failure after all retries, the backup file is preserved so the next import run can use the correct original settings.

Parameters:
  • config (str | dict[str, Any]) – Path to connection config file or config dict.

  • settings (VatValidationSettings) – The VatValidationSettings object with original settings to restore.

  • backup_dir (Path | None) – Optional custom backup directory for settings file.

  • max_retries (int) – Maximum number of retry attempts (default: 5).

  • initial_delay (float) – Initial delay between retries in seconds (default: 2.0).

  • max_delay (float) – Maximum delay between retries in seconds (default: 60.0).

Returns:

True if successful, False otherwise.

Return type:

bool

fluvo.lib.actions.vies_manager.run_vies_validation(config, batch_size=50, delay_between_batches=1.0, notify_user_ids=None, domain=None, max_records=None)

Batch validate VAT numbers against VIES and notify on failures.

This action finds partners with VAT numbers and validates them against the EU VIES service in small batches to avoid timeouts.

Parameters:
  • config (str | dict[str, Any]) – Path to connection config file or config dict.

  • batch_size (int) – Number of partners to validate per batch.

  • delay_between_batches (float) – Seconds to wait between batches.

  • notify_user_ids (list[int] | None) – List of user IDs to notify on invalid VATs. If None, uses the partner’s responsible user.

  • domain (list[Any] | None) – Additional domain to filter partners.

  • max_records (int | None) – Maximum number of records to validate.

Returns:

ViesValidationResult with validation statistics.

Return type:

ViesValidationResult

fluvo.lib.actions.vies_manager.run_import_with_vat_validation_disabled(config, import_func, import_kwargs, company_ids=None, disable_vies=True, disable_stdnum=True, validate_vat_locally=False, backup_dir=None)

Run an import function with VAT validation temporarily disabled.

This is a convenience wrapper that: 1. Saves current VAT validation settings (VIES and/or stdnum) to backup file 2. Disables validation for all/specified companies 3. Optionally validates VAT numbers locally before import 4. Runs the import function 5. Restores original settings with automatic retry on transient errors 6. Deletes backup file on successful restoration

If restoration fails, the backup file is preserved so the next import run will use the correct original settings instead of the (possibly incorrect) database values.

Parameters:
  • config (str | dict[str, Any]) – Path to connection config file or config dict.

  • import_func (Any) – The import function to run.

  • import_kwargs (dict[str, Any]) – Keyword arguments to pass to import function.

  • company_ids (list[int] | None) – Optional list of company IDs to disable validation for.

  • disable_vies (bool) – Whether to disable VIES online check.

  • disable_stdnum (bool) – Whether to disable stdnum format validation.

  • validate_vat_locally (bool) – If True, validates VAT numbers locally before import using the fast regex-based validator (or custom Rust validator).

  • backup_dir (Path | None) – Optional custom backup directory for settings file.

Returns:

The result of import_func.

Return type:

Any

Module Manager (lib.actions.module_manager)

This module provides functions for managing Odoo modules.

This module contains workflows for managing Odoo modules.

fluvo.lib.actions.module_manager.run_update_module_list(config)

Connects to Odoo and triggers the ‘Update Apps List’ action.

This function is synchronous and will wait for the server to complete the scan before returning.

Parameters:

config (str) – Path to the connection configuration file.

Returns:

True if the operation was successful, False otherwise.

Return type:

bool

fluvo.lib.actions.module_manager.run_module_installation(config, modules)

Connects to Odoo and runs the module upgrade/install process.

This function finds the specified modules, checks their current state, and then triggers the appropriate ‘install’ or ‘upgrade’ action.

Parameters:
  • config (str) – Path to the connection configuration file.

  • modules (list[str]) – A list of technical module names to install or upgrade.

Return type:

None

fluvo.lib.actions.module_manager.run_module_uninstallation(config, modules)

Connects to Odoo and runs the module uninstallation process.

Parameters:
  • config (str) – Path to the connection configuration file.

  • modules (list[str]) – A list of technical module names to uninstall.

Return type:

None