Product Average Price From Invoices
This module computes, from posted invoices, two average prices and stores them on product templates and product variants:
- Average Purchase Price (APP), from vendor bills.
- Average Sale Price (ASP), from customer invoices.
Each one is a weighted average: the untaxed subtotal of the invoice lines divided by the invoiced quantity. Taxes and added costs (landed costs, for instance) are excluded, and so are refunds, as a returned quantity is not a price the product was traded at.
Both prices are company dependent: every company gets its own figures, computed from its own invoices and with its own window settings, so each one sees the prices it traded at.
Instead of a fixed period, an expanding window is used: the last 30 days are checked first and, while no invoiced quantity is found, the window is widened 30 days at a time up to 360 days. The first window with data wins, and the range it covers is stored next to the price, so the figure is always readable in context. Both the step size and the maximum number of steps are configurable.
Templates and variants are computed independently: a template averages the invoices of all its variants over a single window, a variant averages only its own. Because of that, they may end up using different periods.
Values are stored, not computed on the fly. They are refreshed by a daily scheduled action, and on demand from the product form, where the journal items behind each price can also be opened.
auto_awesome What this module does
AI-generated from the code · Odoo 17.0Shows two average prices on each product — an average purchase price from vendor bills and an average sale price from customer invoices — with a button to recompute them and a link to see the invoices behind the figure.
This module adds two read-only price fields to product templates and product variants, visible to users with invoicing rights:
- APP (average purchase price), calculated from posted vendor bills.
- ASP (average sale price), calculated from posted customer invoices.
Both are weighted averages: the untaxed amount of the invoice lines divided by the invoiced quantity, so taxes and added costs are left out. Refunds are not counted. Each company keeps its own figures.
The prices are not taken over a fixed period. The system first looks at the most recent days (30 by default) and, if no invoiced quantity is found, widens the window step by step (up to 12 steps by default, so 360 days) until it finds data. The date range actually used is shown next to each price, or a message saying no data was found in the whole window.
On the product form, next to each price there is a refresh button to recompute it on demand and a link that opens the journal items the figure was built from. A scheduled job runs every night to refresh the products invoiced recently. The step size and maximum number of steps can be changed in the Accounting settings under "Product Average Prices".
Depends on
Models and fields (5)
- res.company · extends an existing modelavg_price_max_steps (Average Price Max Steps), avg_price_step_days (Average Price Step (days))
- product.product · new model
- product.template · new model
- res.config.settings · extends an existing modelavg_price_max_steps, avg_price_step_days
- product.average.price.mixin · new modelavg_sale_price (ASP), avg_purchase_price (APP), avg_sale_price_period, avg_sale_price_date_to, avg_sale_price_date_from, avg_purchase_price_period, avg_purchase_price_date_to, avg_purchase_price_date_from
Text generated by AI (DeepSeek) from reading the Odoo 17.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 17.0
Confirmed on 2026-11-03 in branch 17.0 of OCA/account-invoicing.
terminal Installation and usage
OCA documentation · Odoo 17.0Usage
Source · Odoo 17.0Consulting the prices
Go to a product template or a product variant, General Information tab, right below the Cost field see APP and ASP, each one followed by the period it was computed for (From ... to ...)
A price of 0.00 labelled No data means no invoiced quantity was found within the widest window. In that case no period is stored, and the arrow button opens an empty list.
What is shown always belongs to the active company. Switching companies shows the prices that company computed from its own invoices.
Refreshing automatically
The Update product average prices scheduled action runs every night and recomputes, for every company, the products it invoiced within the widest window, at both variant and template level. Its frequency can be changed in Settings > Technical > Scheduled Actions.
Configuring the window
Go to Settings > Accounting, section Product Average Prices. Both values belong to the active company:
- Step size (days): length of each step of the window, 30 by default.
- Max steps: how many times the window may be widened before giving up, 12 by default, so the search goes back 360 days at most.
Changing them does not recompute anything by itself. Stored prices keep the window they were computed with until the scheduled action or a button refreshes them.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.