refactor: replace group_operator with aggregator parameter in POS KDS report fields

This commit is contained in:
Suherdy Yacob 2026-05-28 14:00:36 +07:00
parent 359a11af1f
commit 4b5649f5d1

View File

@ -20,12 +20,12 @@ class PosKdsReportLine(models.Model):
('cancelled', 'Cancelled') ('cancelled', 'Cancelled')
], string='Status', default='done', index=True) ], string='Status', default='done', index=True)
preparation_time = fields.Integer('Preparation Time (s)', group_operator='sum', help="Seconds taken to prepare") preparation_time = fields.Integer('Preparation Time (s)', aggregator='sum', help="Seconds taken to prepare")
preparation_time_avg = fields.Integer('Average Preparation Time (s)', group_operator='avg', help="Average seconds taken to prepare") preparation_time_avg = fields.Integer('Average Preparation Time (s)', aggregator='avg', help="Average seconds taken to prepare")
service_time = fields.Integer('Service Time (s)', group_operator='sum', help="Seconds taken to serve") service_time = fields.Integer('Service Time (s)', aggregator='sum', help="Seconds taken to serve")
service_time_avg = fields.Integer('Average Service Time (s)', group_operator='avg', help="Average seconds taken to serve") service_time_avg = fields.Integer('Average Service Time (s)', aggregator='avg', help="Average seconds taken to serve")
completion_time = fields.Integer('Completion Time (s)', group_operator='sum', help="Total seconds taken to complete (prep + service)") completion_time = fields.Integer('Completion Time (s)', aggregator='sum', help="Total seconds taken to complete (prep + service)")
completion_time_avg = fields.Integer('Average Completion Time (s)', group_operator='avg', help="Average total seconds taken to complete") completion_time_avg = fields.Integer('Average Completion Time (s)', aggregator='avg', help="Average total seconds taken to complete")
completion_datetime = fields.Datetime('Completion Date', default=fields.Datetime.now, index=True) completion_datetime = fields.Datetime('Completion Date', default=fields.Datetime.now, index=True)
@api.depends('product_id') @api.depends('product_id')
@ -76,12 +76,12 @@ class PosKdsReportOrder(models.Model):
('cancelled', 'Cancelled') ('cancelled', 'Cancelled')
], string='Status', default='done', index=True) ], string='Status', default='done', index=True)
preparation_time = fields.Integer('Preparation Time (s)', group_operator='sum', help="Max preparation time across lines") preparation_time = fields.Integer('Preparation Time (s)', aggregator='sum', help="Max preparation time across lines")
preparation_time_avg = fields.Integer('Average Preparation Time (s)', group_operator='avg', help="Average preparation time across lines") preparation_time_avg = fields.Integer('Average Preparation Time (s)', aggregator='avg', help="Average preparation time across lines")
service_time = fields.Integer('Service Time (s)', group_operator='sum', help="Max service time across lines") service_time = fields.Integer('Service Time (s)', aggregator='sum', help="Max service time across lines")
service_time_avg = fields.Integer('Average Service Time (s)', group_operator='avg', help="Average service time across lines") service_time_avg = fields.Integer('Average Service Time (s)', aggregator='avg', help="Average service time across lines")
completion_time = fields.Integer('Completion Time (s)', group_operator='sum', help="Max completion time across all lines of the order on this display") completion_time = fields.Integer('Completion Time (s)', aggregator='sum', help="Max completion time across all lines of the order on this display")
completion_time_avg = fields.Integer('Average Completion Time (s)', group_operator='avg', help="Average completion time across all lines of the order on this display") completion_time_avg = fields.Integer('Average Completion Time (s)', aggregator='avg', help="Average completion time across all lines of the order on this display")
completion_datetime = fields.Datetime('Completion Date', default=fields.Datetime.now, index=True) completion_datetime = fields.Datetime('Completion Date', default=fields.Datetime.now, index=True)
@api.depends('pos_order_id') @api.depends('pos_order_id')