1.6 KiB
1.6 KiB
Stock Valuation Layer Category Groupby
Description
This module allows grouping by product category in the stock valuation layer reports.
Problem
By default, the categ_id field in stock.valuation.layer is a related field without storage (store=False). This means it cannot be used for grouping in reports and pivot views, even though it can be used for filtering and searching.
Solution
This module makes the categ_id field stored (store=True) and indexed, which enables:
- Grouping by product category in list views
- Grouping by product category in pivot views
- Grouping by product category in graph views
- Better performance when filtering by category
Installation
- Install the module from the Apps menu
- The field will be automatically populated for existing records
Usage
After installation:
- Go to Inventory > Reporting > Inventory Valuation
- Switch to Pivot or Graph view
- Click on "Measures" or group options
- You will now see "Product Category" available for grouping
Technical Details
The module extends stock.valuation.layer model and modifies the categ_id field to:
store=True: Store the value in the databaseindex=True: Add database index for better performance
The field remains a related field, so it will automatically update when the product category changes.
Bug Tracker
Bugs are tracked on GitHub Issues.
Credits
Contributors
- Criptomart
Maintainers
This module is maintained by the OCA.
Compatibility
- Odoo 16.0
- stock_account