This commit is contained in:
Elvis 2023-11-15 09:11:53 -05:00
parent 1155bccfdc
commit e8b31acd6c
3 changed files with 19 additions and 13 deletions

View File

@ -398,28 +398,34 @@ class CustomerService(metaclass=PoolMeta):
days_diference = datetime.now() - self.cs_date
if self.media == 'supersalud':
if self.classification == 'reclamo_riesgo_vital' and self.state == 'open':
return 'Higher'
# return 'Higher'
return 'Alto'
if self.classification == 'reclamo_riesgo_priorizado' and self.state == 'open':
if days_diference.days == 0:
return 'Medium'
# return 'Medium'
return 'Medio'
if days_diference.days >= 1:
return 'Higher'
# return 'Higher'
return 'Alto'
if self.classification == 'reclamo_riesgo_simple' and self.state == 'open':
if days_diference.days >= 2:
return 'Higher'
# return 'Higher'
return 'Alto'
if days_diference.days >= 1:
return 'Medium'
return 'low'
# return 'Medium'
return 'Medio'
# return 'low'
return 'Bajo'
@classmethod
def search_current_risk(cls, name, clause):
cursor = Transaction().connection.cursor()
if clause[2] == 'Higher':
if clause[2] == 'higher':
query = f"""select id from crm_customer_service where (state='open' AND media='supersalud') AND
((classification='reclamo_riesgo_vital') OR
(DATE_PART('day', CURRENT_DATE - cs_date) > 0 AND classification='reclamo_riesgo_priorizado') OR
(DATE_PART('day', CURRENT_DATE - cs_date) > 1 AND classification='reclamo_riesgo_simple'));"""
elif clause[2] == 'Medium':
elif clause[2] == 'medium':
query = f"""select id from crm_customer_service where (state='open' AND media='supersalud') AND
((DATE_PART('day', CURRENT_DATE - cs_date)=0 AND classification='reclamo_riesgo_priorizado') OR
(DATE_PART('day', CURRENT_DATE - cs_date)=1 AND classification='reclamo_riesgo_simple'));"""

View File

@ -262,7 +262,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Higher</field>
<field name="sequence" eval="90"/>
<field name="domain" eval="[
('current_risk', '=', 'Higher'),
('current_risk', '=', 'higher'),
('state', '=', 'open'),
]" pyson="1"/>
<field name="act_window" ref="crm.act_customer_service_form"/>
@ -272,7 +272,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="sequence" eval="90"/>
<field name="domain" eval="[
('state', '=', 'open'),
('current_risk', '=', 'Medium')
('current_risk', '=', 'medium')
]" pyson="1"/>
<field name="act_window" ref="crm.act_customer_service_form"/>
</record>

View File

@ -413,17 +413,17 @@ msgstr "Reporte Fiduprevisora"
msgctxt ""
"model:ir.action.act_window.domain,name:act_customer_service_form_domain_higher"
msgid "Higher"
msgstr ""
msgstr "Alto"
msgctxt ""
"model:ir.action.act_window.domain,name:act_customer_service_form_domain_low"
msgid "Low"
msgstr ""
msgstr "Bajo"
msgctxt ""
"model:ir.action.act_window.domain,name:act_customer_service_form_domain_medium"
msgid "Medium"
msgstr ""
msgstr "Medio"
msgctxt "model:ir.ui.menu,name:"
msgid "Cities"