Definition of measures and how to use them in ERP5. Notes to help developers
Table of Contents
A measure allows to specify the magnitude (-> quantity * quantity_unit) of some
attribute (-> metric_type) of a resource (ex: Product, Service...), such as its
length or mass. Thus, an amount of a resource can be expressed according to any
of its metric types.
A measure is defined on a resource and is roughly a triplet (metric_type,
A measure describes a resource in respect to 1 management unit of the resource.
The quantity_unit base category is a database of measurement units. It is filled
independently from any resource.
Units used for a given physical quantity are grouped in the same subcategory,
so we have the following schema:
Each unit has a quantity property containing the ratio in respect to a base
unit (of the same physical quantity). The ratio must be 1 for a base one.
quantity_unit/unit/unit (quantity = 1)
quantity_unit/unit/dozen (quantity = 12)
quantity_unit/mass/lb (quantity = .45359237)
quantity_unit/mass/g (quantity = .001)
quantity_unit/mass/kg (quantity = 1)
metric_type is a base category defining any attribute a resource might have.
The schema must be similar to quantity_unit so that it is possible to determine
relevant units for each metric type:
A measure object must be added to a resource for any metric type you want to describe.
To add a measure:
Variations are supported: When the resource is variated, you can choose according
to which base category the measure is variated.
From the Measure tab of a resource, you can see the measures in a listbox. You
can also edit them directly.
Only specifying 'quantity * quantity_unit' is not enough to represent an amount
of resource. In principle, a metric type should also be given, because a resource
may have several metric types using the same physical quantity.
For example, the gram could represent either the "gross weight" or the "net
weight" of a resource.
Since there are places in ERP5 where you can only choose a quantity unit, there
is a way to associate a default measure to each physical quantity, thanks to the
Default Metric Type setting of a measure.
The first quantity unit of a resource is its management unit.
An implicit measure is created for the management unit, in case there isn't any.
The metric type used for such a measure is a generic one, i.e.
If you want to manage a resource according to a specific metric type, you must
create a measure for the management unit, with the following restriction:
Then, check Default Metric Type.
Note: The validation of a resource will check that all measures and units
From a resource module page, a Converted Inventory Report is available:
Only metric types common to all selected resources can be chosen.
Let's given a box of 12 eggs, knowing that there are several sizes of eggs:
small (S): less than 53 g
medium (M): between 53 and 63 g
big (L): between 63 and 73 g
very big (XL): more than 73 g
Create the following measure for the net weight:
variation axes: size
S: 576 (48*12)
M: 696 (58*12)
L: 816 (68*12)
XL: 936 (78*12)
Do the same for the gross weight:
variation axes: size
For the number of eggs per box:
Set the following quantity units to the resource:
unit/unit (management unit)
When buying boxes of eggs, you can specify the quantity of boxes in:
unit/unit: quantity is a number of boxes of 12 eggs.
mass/g: quantity is the net weight (in grams) of the amount of eggs
mass/lb: net weight, in pounds.
You can also know the number of eggs in all nodes: