Skip to main content

Adds distribution rules for stock moves to automatically create analytic lines

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_stock_analytic_rule-17.0.1.0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_stock_analytic_rule-17.0.1.0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8876e65c8e2a6f22510388b3f8562ca064f8222e5fdab3ab8a27c6afb680c420
MD5 4a46e37a991350c690a9cd8c92ec8eaa
BLAKE2b-256 75a84d98a6379f7daa14530c8cffc841986c6e56c6cf7e490aa2197a4af40741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page