Merge pull request #3341 from expsa/kch_dev_odex25_transactions
IMP show average response time per employee for incoming transactions
This commit is contained in:
commit
903d27b5b8
|
|
@ -3653,21 +3653,6 @@ msgstr "فترة إنجاز"
|
||||||
msgid "Response Days"
|
msgid "Response Days"
|
||||||
msgstr "فترة الإنجاز (أيام)"
|
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
|
#. module: exp_transaction_documents
|
||||||
#: code:addons/exp_transaction_documents/models/internal_transaction.py:0
|
#: code:addons/exp_transaction_documents/models/internal_transaction.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,6 @@ class InternalTransaction(models.Model):
|
||||||
last_response_date = fields.Datetime(string="Last Response Date")
|
last_response_date = fields.Datetime(string="Last Response Date")
|
||||||
response_time_str = fields.Char(string="Response Time", compute="_compute_response_time", store=True)
|
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_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')
|
@api.depends('last_response_date', 'create_date')
|
||||||
def _compute_response_time(self):
|
def _compute_response_time(self):
|
||||||
|
|
@ -40,28 +37,25 @@ class InternalTransaction(models.Model):
|
||||||
|
|
||||||
rec.response_days = total_seconds // 86400
|
rec.response_days = total_seconds // 86400
|
||||||
remainder = total_seconds % 86400
|
remainder = total_seconds % 86400
|
||||||
rec.response_hours = remainder // 3600
|
hours = remainder // 3600
|
||||||
remainder = remainder % 3600
|
remainder = remainder % 3600
|
||||||
rec.response_minutes = remainder // 60
|
minutes = remainder // 60
|
||||||
rec.response_seconds = remainder % 60
|
seconds = remainder % 60
|
||||||
|
|
||||||
parts = []
|
parts = []
|
||||||
if rec.response_days:
|
if rec.response_days:
|
||||||
parts.append(_("%s day") % rec.response_days)
|
parts.append(_("%s day") % rec.response_days)
|
||||||
if rec.response_hours:
|
if hours:
|
||||||
parts.append(_("%s hour") % rec.response_hours)
|
parts.append(_("%s hour") % hours)
|
||||||
if rec.response_minutes:
|
if minutes:
|
||||||
parts.append(_("%s minute") % rec.response_minutes)
|
parts.append(_("%s minute") % minutes)
|
||||||
if rec.response_seconds or not parts:
|
if seconds or not parts:
|
||||||
parts.append(_("%s second") % rec.response_seconds)
|
parts.append(_("%s second") % seconds)
|
||||||
|
|
||||||
rec.response_time_str = ", ".join(parts)
|
rec.response_time_str = ", ".join(parts)
|
||||||
else:
|
else:
|
||||||
rec.response_time_str = ""
|
rec.response_time_str = ""
|
||||||
rec.response_days = 0
|
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')
|
# 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)
|
# delegate_employee_id = fields.Many2one('cm.entity', related='to_ids.delegate_employee_id',store=True)
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@
|
||||||
<field name="create_uid" string="Send From"/>
|
<field name="create_uid" string="Send From"/>
|
||||||
<field name="to_ids"/>
|
<field name="to_ids"/>
|
||||||
<field name="due_date"/>
|
<field name="due_date"/>
|
||||||
<field name="response_time_str" invisible="not context.get('show_response_fields', False)" optional="hide"/>
|
<field name="response_time_str" optional="hide"/>
|
||||||
<field name="response_days" invisible="not context.get('show_response_fields', False)"/>
|
<field name="response_days" optional="hide"/>
|
||||||
<!--avg="avg response_days"-->
|
<!--avg="avg response_days"-->
|
||||||
<field name="state" optional="show"/>
|
<field name="state" optional="show"/>
|
||||||
<field name="is_favorite" string=" " widget="priority"/>
|
<field name="is_favorite" string=" " widget="priority"/>
|
||||||
|
|
@ -122,9 +122,6 @@
|
||||||
<field name="last_response_date" invisible="1"/>
|
<field name="last_response_date" invisible="1"/>
|
||||||
<field name="response_time_str"/>
|
<field name="response_time_str"/>
|
||||||
<field name="response_days"/>
|
<field name="response_days"/>
|
||||||
<field name="response_hours" invisible="1"/>
|
|
||||||
<field name="response_minutes" invisible="1"/>
|
|
||||||
<field name="response_seconds" invisible="1"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='tran_tag']" position="after">
|
<xpath expr="//field[@name='tran_tag']" position="after">
|
||||||
<field name="to_delegate" readonly="1" force_save="1"/>
|
<field name="to_delegate" readonly="1" force_save="1"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue