OdooWiki OCA HUB

Web Pivot Computed Measure

web_pivot_computed_measure folder_open OCA/web open_in_new
web License: AGPL-3

Adds support for computed measures on the pivot view.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets users create their own calculated measures directly inside pivot views, combining two existing measures with sum, subtraction, multiplication, division or percentage, without any developer work.

This module extends the pivot view measure selector with a new "Computed Measure" option. From the measures dropdown of any pivot view, users open a small form where they pick Measure 1, Measure 2, an operation (Sum, Sub, Mult, Div or Perc), an optional name and a display format (Integer, Float or Percentage), then click Add.

The new measure is added to the pivot and its values are calculated for every cell from the two source measures. It can be used like any other measure, and it is stored in the context so it is kept when the pivot is saved as a favourite filter and reloaded later.

Business rules shown in the code: - A source measure that is used by an active computed measure cannot be switched off; the user is told to disable the computed measure first. - Enabling a computed measure automatically enables the measures it depends on. - Division by zero is displayed as "-" instead of an error. - In developer/debug mode an extra "Custom" operation is available, where a free formula can be typed.

The module only touches the web client pivot view; no new business models are added. A demo pivot view on res.partner and a demo menu are provided for testing.

Depends on

web

Menus it adds

demo_menu_res_partner_report_pivot

Text generated by AI (DeepSeek) from reading the Odoo 18.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-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 6 confirmed, 3 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 18.0

Go to pivot view and click on the "Measures" menu, you will see a new option called 'Computed Measure'.

You have the follow options to create a 'computed measure':

  • Measure 1: Used in 'operation formula' as 'm1'
  • Measure 2: Used in 'operation formula' as 'm2'
  • Operation: The formula
  • Sum: m1 + m2
  • Sub: m1 - m2
  • Mult: m1 * m2
  • Div: m1 / m2 (Format: Float)
  • Perc m1 / m2 (Format: Percentage)
  • Custom: Special option only visible in debug mode to write a custom formula.
  • Name: The name of the new measure (emtpy = auto-generated)
  • Format: How will the value be printed
  • Integer
  • Float
  • Percentage (value * 100)
  • Formula*: Custom operation formula These formula is evaluated using 'PY.eval'

These computed measures can be mixed (You can reuse it to make new computed measures) and saved as favorites.

Notice that "measures/computed measures" involved in an active 'computed measure' can't be deactivated until you have deactivate the 'computed measure'.

No verified information in OCA: Installation, Configuration.

info

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.