From c5398bd4bc84a4e2bce16eb22564c87073a28c30 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Wed, 27 Nov 2019 10:06:36 +0000 Subject: [PATCH] [IMP] doc : group_operator field attribute closes odoo/odoo#40944 X-original-commit: 7cbad14e28c50d51c14683d2548ea32ebc58907f Signed-off-by: Victor Feyens (vfe) --- odoo/fields.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/odoo/fields.py b/odoo/fields.py index 414b36483c9..eb26110414e 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -165,6 +165,21 @@ class Field(MetaField('DummyField', (object,), {})): :param bool store: whether the field is stored in database (default:``True``, ``False`` for computed fields) + :param str group_operator: aggregate function used by :meth:`~odoo.models.Model.read_group` + when grouping on this field. + + Supported aggregate functions are: + + * ``array_agg`` : values, including nulls, concatenated into an array + * ``count`` : number of rows + * ``count_distinct`` : number of distinct rows + * ``bool_and`` : true if all values are true, otherwise false + * ``bool_or`` : true if at least one value is true, otherwise false + * ``max`` : maximum value of all values + * ``min`` : minimum value of all values + * ``avg`` : the average (arithmetic mean) of all values + * ``sum`` : sum of all values + .. rubric:: Computed Fields :param str compute: name of a method that computes the field