[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:
parent
348da6ec78
commit
564f2640c7
@ -884,7 +884,12 @@ A domain is a list of criteria, each criterion being a triple (either a
|
|||||||
* ``field_name`` (``str``)
|
* ``field_name`` (``str``)
|
||||||
a field name of the current model, or a relationship traversal through
|
a field name of the current model, or a relationship traversal through
|
||||||
a :class:`~odoo.fields.Many2one` using dot-notation e.g. ``'street'``
|
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``)
|
* ``operator`` (``str``)
|
||||||
an operator used to compare the ``field_name`` with the ``value``. Valid
|
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'),
|
[('invoice_status', '=', 'to invoice'),
|
||||||
('order_line', 'any', [('product_id.qty_available', '<=', 0)])]
|
('order_line', 'any', [('product_id.qty_available', '<=', 0)])]
|
||||||
|
|
||||||
|
|
||||||
|
To search for all partners born in the month of February::
|
||||||
|
|
||||||
|
[('birthday.month_number', '=', 2)]
|
||||||
|
|
||||||
Unlink
|
Unlink
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
Changelog
|
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
|
Odoo Online version 17.2
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user