Skip to main content
Odoo Community Association

Product Average Price From Invoices

Beta License: AGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runboat

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.

Table of contents

Usage

Consulting 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.

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

  • Tecnativa

Contributors

  • Tecnativa:

    • Eduardo Ezerouali

    • Pedro M. Baeza

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:

eduezerouali-tecnativa

This module is part of the OCA/account-invoicing project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

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_product_average_price_invoice-17.0.1.0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_product_average_price_invoice-17.0.1.0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03fd0d62b66ef5554904bae0dd6f414e1235cfe94de7c446d7b6a435c2d61c7f
MD5 6b66a5942cf4339c53ee33753d7249ca
BLAKE2b-256 f4cf264f5a286386014bdc5841c0a8247cf5d721c73ceef8be736d01d6764994

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 Sentry Error logging StatusPage Status page