Skip to main content
Odoo Community Association

Stock Analytic Rule

Beta License: AGPL-3 OCA/account-analytic Translate me on Weblate Try me on Runboat

This module extends the stock and analytic accounting capabilities by automatically creating analytic lines from stock based on configurable rules.

Key features:

  • Define stock movement rules by source and destination locations.

  • Compute analytic line amounts using either:

    • Product list price.

    • Category-based formula: (avg_price * (avg_weight * qty)) + ((avg_weight * qty) * supplement)

  • Support for positive and negative analytic distributions.

  • Handles partial distributions and multi-account combinations.

  • Supports return pickings and reversal analytic lines.

  • Fully compatible with analytic plans and multidimensional analytic accounting.

The module is useful for organizations needing precise analytic accounting for inventory movements, such as manufacturing, logistics, or services.

Table of contents

Usage

  1. Configure Product Categories

Navigate to Inventory > Configuration > Product Categories.

For each relevant product category, configure the following fields:

  • Average Price: Base cost per unit.

  • Average Weight: Used to scale the cost relative to quantity.

  • Supplement: Additional surcharge applied on top of base cost.

These values are used when the compute type is set to Category.


  1. Define Analytic Accounts and Plans

Navigate to Accounting > Configuration > Analytic Accounting.

  • Create one or more Analytic Plans.

  • Create Analytic Accounts linked to these plans.

These accounts will be referenced in the analytic distribution logic of each model.


  1. Create Stock Analytic Rules

Navigate to Accounting > Configuration > Stock Analytic Rules.

Configure each rule with:

  • Name: Used as the label for the generated analytic lines.

  • Source Locations and Destination Locations: Determines when the model applies.

  • Amount Compute Type: Choose between:

    • Product – uses the product’s list price.

    • Category – uses the category’s formula (avg_price × weight × qty) + (weight × qty × supplement).

  • Analytic Distribution (for positive lines)

  • Negative Analytic Distribution (for negative lines)

  • Financial Account: Used in the generated analytic line.

📌 Note: The distribution for reversed moves (e.g. returns) is automatically computed by inverting the accounts — no need to define a separate rule.

  1. Perform a Stock Move

Create a Transfer that matches the configured rule:

  • It can be internal, delivery, or receipt.

  • Ensure the source and destination locations match the analytic rule.

  1. Review Analytic Lines

Navigate to Accounting > Accounting > Analytic Lines.

You should now see the automatically generated analytic lines reflecting the cost and distribution defined in your model.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • APSL-Nagarro

  • Bernat Obrador

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

BernatObrador

This module is part of the OCA/account-analytic project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-stock-analytic-rule 17.0.1.0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-stock-analytic-rule 17.0.1.0.0.5
File Interpreter ABI Platform
odoo_addon_stock_analytic_rule-17.0.1.0.0.5-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_stock_analytic_rule-17.0.1.0.0.5-py3-none-any.whl

Download URL odoo_addon_stock_analytic_rule-17.0.1.0.0.5-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5338e911c1639b8d7d2dddb24f575c9b53f326af4d6cdb058920ac07929fc924
BLAKE2b-256 checksum
How to use checksums
44f28a2585c4a0d6020c05e941bb7ed446d7f7b38cab622e3c56db30c1045ef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

17.0.1.0.0.5 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page