[IMP] base: add read_group relative granularity

references https://github.com/odoo/odoo/pull/159528

closes odoo/documentation#8447

Task: 3836802
Related: odoo/odoo#159528
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
This commit is contained in:
Vincent Schippefilt 2024-03-29 16:49:42 +01:00
parent 348da6ec78
commit 564f2640c7
2 changed files with 17 additions and 1 deletions

View File

@ -884,7 +884,12 @@ A domain is a list of criteria, each criterion being a triple (either a
* ``field_name`` (``str``)
a field name of the current model, or a relationship traversal through
a :class:`~odoo.fields.Many2one` using dot-notation e.g. ``'street'``
or ``'partner_id.country'``
or ``'partner_id.country'``. If the field is a date(time) field, you can also
specify a part of the date using ``'field_name.granularity'``. The supported
granularities are ``'year_number'``, ``'quarter_number'``, ``'month_number'``, ``'iso_week_number'``,
``'day_of_week'``, ``'day_of_month'``, ``'day_of_year'``, ``'hour_number'``, ``'minute_number'``,
``'second_number'``.
They all use an integer as value.
* ``operator`` (``str``)
an operator used to compare the ``field_name`` with the ``value``. Valid
@ -981,6 +986,11 @@ Domain criteria can be combined using logical operators in *prefix* form:
[('invoice_status', '=', 'to invoice'),
('order_line', 'any', [('product_id.qty_available', '<=', 0)])]
To search for all partners born in the month of February::
[('birthday.month_number', '=', 2)]
Unlink
------

View File

@ -4,6 +4,12 @@
Changelog
=========
Odoo Online version 17.3
========================
- We can now group by date parts numbers in `read_group`, `_read_group` and domains with `#159528 <https://github.com/odoo/odoo/pull/159528>`_.
Odoo Online version 17.2
========================