在Odoo-11按小时分组

问题描述 投票:0回答:1

你知道是否可以按小时制作石斑鱼?我知道白天你可以。

context="{'group_by': 'my_datetime:day'}"

我的意思是这样的odoo过滤器:

<filter name="booking_group" string="Group by Booking" context="{'group_by': 'booking_id'}"
python-3.x odoo-11
1个回答
0
投票

不,这是不可能的。实施的值为“天”,“周”,“月”,“季度”或“年”(参见<path_to_v12/odoo/models.py第1878至1899行):

1878     @api.model
1879     def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
1880         """
1881         Get the list of records in list view grouped by the given ``groupby`` fields
1882 
1883         :param domain: list specifying search criteria [['field_name', 'operator', 'value'], ...]
1884         :param list fields: list of fields present in the list view specified on the object
1885         :param list groupby: list of groupby descriptions by which the records will be grouped.  
1886                 A groupby description is either a field (then it will be grouped by that field)
1887                 or a string 'field:groupby_function'.  Right now, the only functions supported
1888                 are 'day', 'week', 'month', 'quarter' or 'year', and they only make sense for 
1889                 date/datetime fields.
1890         :param int offset: optional number of records to skip
1891         :param int limit: optional max number of records to return
1892         :param list orderby: optional ``order by`` specification, for
1893                              overriding the natural sort ordering of the
1894                              groups, see also :py:meth:`~osv.osv.osv.search`
1895                              (supported only for many2one fields currently)
1896         :param bool lazy: if true, the results are only grouped by the first groupby and the 
1897                 remaining groupbys are put in the __context key.  If false, all the groupbys are
1898                 done in one call.
1899         :return: list of dictionaries(one dictionary for each record) containing:
© www.soinside.com 2019 - 2024. All rights reserved.