From a9733495e3ee0a849589269e0cce281755da2411 Mon Sep 17 00:00:00 2001 From: younes Date: Wed, 28 May 2025 16:01:21 +0100 Subject: [PATCH] IMP show average response time per employee for incoming transactions --- .../exp_transaction_documents/i18n/ar_001.po | 15 ------------ .../models/internal_transaction.py | 24 +++++++------------ .../views/internal.xml | 7 ++---- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po index cd68d2360..cccad1fed 100644 --- a/odex25_transactions/exp_transaction_documents/i18n/ar_001.po +++ b/odex25_transactions/exp_transaction_documents/i18n/ar_001.po @@ -3653,21 +3653,6 @@ msgstr "فترة إنجاز" msgid "Response Days" msgstr "فترة الإنجاز (أيام)" -#. module: exp_transaction_documents -#: model:ir.model.fields,field_description:exp_transaction_documents.field_internal_transaction__response_hours -msgid "Response Hours" -msgstr "فترة الإنجاز (ساعات)" - -#. module: exp_transaction_documents -#: model:ir.model.fields,field_description:exp_transaction_documents.field_internal_transaction__response_minutes -msgid "Response Minutes" -msgstr "فترة الإنجاز (دقائق)" - -#. module: exp_transaction_documents -#: model:ir.model.fields,field_description:exp_transaction_documents.field_internal_transaction__response_seconds -msgid "Response Seconds" -msgstr "فترة الإنجاز (ثواني)" - #. module: exp_transaction_documents #: code:addons/exp_transaction_documents/models/internal_transaction.py:0 #, python-format diff --git a/odex25_transactions/exp_transaction_documents/models/internal_transaction.py b/odex25_transactions/exp_transaction_documents/models/internal_transaction.py index 40abe5dbf..788c3bc61 100644 --- a/odex25_transactions/exp_transaction_documents/models/internal_transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/internal_transaction.py @@ -27,9 +27,6 @@ class InternalTransaction(models.Model): last_response_date = fields.Datetime(string="Last Response Date") response_time_str = fields.Char(string="Response Time", compute="_compute_response_time", store=True) response_days = fields.Integer(string="Response Days", compute="_compute_response_time", store=True ,group_operator='avg') - response_hours = fields.Integer(string="Response Hours", compute="_compute_response_time", store=True, group_operator='avg') - response_minutes = fields.Integer(string="Response Minutes", compute="_compute_response_time", store=True, group_operator='avg') - response_seconds = fields.Integer(string="Response Seconds", compute="_compute_response_time", store=True, group_operator='avg') @api.depends('last_response_date', 'create_date') def _compute_response_time(self): @@ -40,28 +37,25 @@ class InternalTransaction(models.Model): rec.response_days = total_seconds // 86400 remainder = total_seconds % 86400 - rec.response_hours = remainder // 3600 + hours = remainder // 3600 remainder = remainder % 3600 - rec.response_minutes = remainder // 60 - rec.response_seconds = remainder % 60 + minutes = remainder // 60 + seconds = remainder % 60 parts = [] if rec.response_days: parts.append(_("%s day") % rec.response_days) - if rec.response_hours: - parts.append(_("%s hour") % rec.response_hours) - if rec.response_minutes: - parts.append(_("%s minute") % rec.response_minutes) - if rec.response_seconds or not parts: - parts.append(_("%s second") % rec.response_seconds) + if hours: + parts.append(_("%s hour") % hours) + if minutes: + parts.append(_("%s minute") % minutes) + if seconds or not parts: + parts.append(_("%s second") % seconds) rec.response_time_str = ", ".join(parts) else: rec.response_time_str = "" rec.response_days = 0 - rec.response_hours = 0 - rec.response_minutes = 0 - rec.response_seconds = 0 # to_ids = fields.Many2one(comodel_name='cm.entity', string='Send To') # delegate_employee_id = fields.Many2one('cm.entity', related='to_ids.delegate_employee_id',store=True) diff --git a/odex25_transactions/exp_transaction_documents/views/internal.xml b/odex25_transactions/exp_transaction_documents/views/internal.xml index 117bf2637..e5993917f 100644 --- a/odex25_transactions/exp_transaction_documents/views/internal.xml +++ b/odex25_transactions/exp_transaction_documents/views/internal.xml @@ -54,8 +54,8 @@ - - + + @@ -122,9 +122,6 @@ - - -