在 Odoo-11 中按小时分组
Group by Hours in Odoo-11
你知道是否可以按小时制作石斑鱼?
我知道白天你可以。
context="{'group_by': 'my_datetime:day'}"
我的意思是像这样的 odoo 过滤器:
<filter name="booking_group" string="Group by Booking" context="{'group_by': 'booking_id'}"
不,这是不可能的。实现的值为 'day'、'week'、'month'、'quarter' 或 'year'(参见 <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:
你知道是否可以按小时制作石斑鱼? 我知道白天你可以。
context="{'group_by': 'my_datetime:day'}"
我的意思是像这样的 odoo 过滤器:
<filter name="booking_group" string="Group by Booking" context="{'group_by': 'booking_id'}"
不,这是不可能的。实现的值为 'day'、'week'、'month'、'quarter' 或 'year'(参见 <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: