TIP: You can type at any time to perform a new search.
Stock Analytic Rule
stock_analytic_rule · OCA/account-analytic
Security findings
Migration considerations
view_stock_analytic_rule_tree— View 'view_stock_analytic_rule_tree' is defined with a `<tree>` root tag: renamed to `<list>` in Odoo 18.0. migration-view-tree-tag · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/account-analytic · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Warehouse Management
- Folder size
- 0.13 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/account-analytic
- Last tracking update
- 2026-08-07 08:22:57
- Authors
- Odoo Community Association (OCA), APSL-Nagarro, Bernat Obrador
- Maintainers
- Odoo Community Association (OCA), APSL-Nagarro, Bernat Obrador
- Committers
- Weblate, OCA-git-bot, oca-ci, bobrador
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
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.
Code Analysis
Views touched (5)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
product_category_form_inherit |
product.category.form.inherit | product.category | form | Inherits product.product_category_form_view |
view_account_analytic_line_form_inherit |
view.account.analytic.line.form.inherit | account.analytic.line | form | Inherits analytic.view_account_analytic_line_form |
view_stock_analytic_rule_form |
stock.analytic.rule.form | stock.analytic.rule | form | New |
view_stock_analytic_rule_search |
stock.analytic.rule.search | stock.analytic.rule | search | New |
view_stock_analytic_rule_tree |
stock.analytic.rule.tree | stock.analytic.rule | tree | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (4)
New fields (1)
-
stock_move_idMany2one → stock.moveondelete='cascade'string='Stock Move' args: 'stock.move'
No public methods.
New fields (3)
-
avg_priceFloatdigits=(16, 2)help='This field is used to store the average price of the products'string='Average Price' -
avg_weightFloatdigits=(16, 2)help='This field is used to store the average weight of the products'string='Average Weight' -
supplementFloatdigits=(16, 2)help='This field is used to supplement the cost of the product'
No public methods.
New fields (9)
-
activeBooleandefault=True -
amount_compute_typeSelectiondefault='category'help="\n Category: The amount is computed based on the product's\n category avg price, avg weight, and supplement.\n Product: The amount is computed based on the product's price.\n "required=Truestring='Compute amount by' args: [('category', _('Category')), ('product', _('Product'))] -
analytic_distribution_negativeJsoncompute='_compute_analytic_distribution'copy=Truereadonly=Falsestore=True args: 'Negative Analytic Distribution' -
company_idMany2one → res.companydefault=<expr>required=True args: 'res.company' -
financial_account_idMany2one → account.accountdomain=[('deprecated', '=', False)]help='Financial account to use for the analytic lines.'string='Financial Account' args: 'account.account' -
include_taxesBooleandefault=Falsehelp='If checked, the amount will include taxes when computed by product.' -
location_dest_idsMany2many → stock.locationstring='To' args: 'stock.location', 'stock_analytic_model_location_dest_rel', 'model_id', 'location_id' -
location_from_idsMany2many → stock.locationstring='From' args: 'stock.location', 'stock_analytic_model_location_from_rel', 'model_id', 'location_id' -
nameChar
-
action_open_form(self) -
copy(self, default=None) -
generate_analytic_lines(self, stock_move)@api.modelGenerates analytic lines based on matching stock analytic rules. -
write(self, vals)
New fields (0)
No new fields.
Public methods (2)-
create(self, vals_list)@api.model_create_multi -
write(self, vals)