Commit 30036129 by Arturo Jasso Origel

ajustes en vistas

parent 56306cf5
......@@ -32,7 +32,9 @@ class HelpdeskTicket(models.Model):
problem_solved_on_time = fields.Boolean('¿Solucionamos complementame tu problema?')
good_service_actitude = fields.Boolean('¿Ha sido buena nuestra actitud de Servicio?')
begin_before_ten_min = fields.Boolean('¿COmenzamos a atenderte antes de 10 minutos?')
is_support = fields.Boolean('Es soporte',compute='_compute_ticket_type')
is_erp = fields.Boolean('Es ERP',compute='_compute_ticket_type')
is_emergency = fields.Boolean('Es 911',compute='_compute_ticket_type')
def _get_color(self):
......@@ -48,6 +50,23 @@ class HelpdeskTicket(models.Model):
rec.color = 10
@api.depends('team_id')
def _compute_ticket_type(self):
for ticket in self:
if ticket.team_id.id == self.env.ref('helpdesk_morsa.techinnical_support').id:
ticket.is_support = True
else:
ticket.is_support = False
if ticket.team_id.id == self.env.ref('helpdesk_morsa.erp_asistense').id:
ticket.is_erp = True
else:
ticket.is_erp = False
if ticket.team_id.id == self.env.ref('helpdesk_morsa.ti_emergency').id:
ticket.is_emergency = True
else:
ticket.is_emergency = False
def assign_me(self):
self.user_id = self.env.user.id
......
......@@ -8,9 +8,13 @@
<field name="priority" eval="17"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='priority']" position="after">
<field name="erp_id" attrs="{'invisible':[('team_id', '!=', 2)]}"/>
<field name="warehouse_id" attrs="{'invisible':[('team_id', '!=', 2)]}"/>
<field name="incidence_type" attrs="{'invisible':[('team_id', '!=', 3)]}"/>
<field name="is_support" invisible="1"/>
<field name="is_erp" invisible="1"/>
<field name="is_emergency" invisible="1"/>
<field name="erp_type" widget="radio" attrs="{'invisible':[('is_erp', '=', False)]}" options="{'horizontal': true}"/>
<field name="erp_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="warehouse_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="incidence_type" attrs="{'invisible':[('is_emergency', '=', False)]}"/>
</xpath>
<xpath expr="//header" position="replace">
<header>
......@@ -25,6 +29,9 @@
<field name="stage_id" widget="statusbar"/>
</header>
</xpath>
<xpath expr="//field[@name='tag_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sh_lead_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment