Stock Analytic Rule

Adds distribution rules for stock moves to automatically create analytic lines

Technical Name:
stock_analytic_rule
Version:
17.0
License:
Author:
APSL-Nagarro, Bernat Obrador
https://odoo-community.org/web/image/product.template/716772/image_1920?unique=3a79b0e
  • Odoo Version

Read the rules established to regulate the OCA (Bylaws )

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.

This is a preview of the recently viewed products by the user.
Once the user has seen at least one product this snippet will be visible.

Recently viewed Products