Commit cd303dd1 by Maria Agustina

comienzo moduilo soporte incidencias

0 parents
# -*- coding: utf-8 -*-
from . import models
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
{
'name': "hgt_soporte",
'summary': """
Módulo hgt_soporte para clientes""",
'description': """
Módulo hgt_soporte de tickets de incidencias para clientes
""",
'author': 'HGT',
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Project Management',
'version': '0.00.00.21',
# any module necessary for this one to work correctly
'depends': ['base',
],
# always loaded
'data': [
'security/permisos.xml',
'security/ir.model.access.csv',
'views/incidencia_view.xml',
'views/menu.xml',
],
# only loaded in demonstration mode
'demo': [
#'demo/demo.xml',
],
'application': True,
'installable': True,
}
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
from . import incidencia
from . import estados
\ No newline at end of file \ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
from odoo import api, fields, models
class hgt_soporte_estado(models.Model):
""" Model for case stages. This models the main stages of a document
management flow. Main CRM objects (leads, opportunities, project
issues, ...) will now use only stages, instead of state and stages.
Stages are for example used to display the kanban view of records.
"""
_name = "hgt.soporte_estado"
_description = "Estados de las incidencias"
_rec_name = 'name'
_order = "sequence, name, id"
name = fields.Char(string='Nombre del estado', required=True)
sequence = fields.Integer(string='Secuencia', default=1, help="Usado para ordenar los estados, mientras mas bajo mas importante.")
fold = fields.Boolean(string='Replegado',
help='Esto oculta por defecto las incidencias contenidas.')
observaciones = fields.Char(string='Requisitos de la incidencia para estar en un estado', required=False)
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import models, fields, api
import datetime
from datetime import date
class hgt_soporte_incidencia(models.Model):
_name = 'hgt.soporte_incidencia'
_rec_name='si_numero'
_order = "id desc"
si_numero = fields.Char(string='Numero de ticket')
si_fecha = fields.Date(
string = 'Fecha de creación',
default = str(date.today())
)
si_responsable = fields.Many2one(
string = 'Responsable',
comodel_name = 'res.users',
ondelete = 'set null',
default = lambda self: self.env.user.id
)
si_descripcion = fields.Text(
string=u'Descripción',
)
si_estado = fields.Many2one('hgt.soporte_estado', string='Estado', track_visibility='onchange', index=True,
group_expand="_read_group_stage_ids")
si_responsabilidad = fields.Selection(
string=u'Responsabilidad',
selection=[('pro', 'Propia'), ('ter', 'Tercero'), ('cli', 'Cliente'), ('cat', 'Catástrofe')]
)
si_url = fields.Char(string='Url de ticketera')
_sql_constraints = [('id_ost_uniq', 'unique (id_ost)', 'Id Ticket must be unique.')]
si_id_ost = fields.Integer(string='Id osticket')
si_ost_cliente = fields.Char(string='Ost cliente')
si_ost_asunto = fields.Char(string='Ost asunto')
si_ost_mail = fields.Char(string='Ost mail')
si_ost_telefeno = fields.Char(string='Ost telefono')
si_ost_mensaje = fields.Text(string='Mensajes')
#forma de adjuntar queda pendiente
def mensajes_ost(self, val):
#print(val[0])
dom = [["si_numero", "=", val[0]]]
ins = self.env['hgt.soporte_incidencia'].search(dom, limit=1)
if len(ins) == 0:
#print("no esta en sistema")
return(True)
text_orig = ins.si_ost_mensaje
texto_nuevo = """\n{} {} {} \n{}\n\n#######################################################\n""".format(val[1],val[2],val[4],val[3])
Texto = """{}\n{}""".format(text_orig,texto_nuevo)
#print(Texto)
ins.si_ost_mensaje = Texto
return(True)
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hgt_soporte_incidencia,access_hgt_soporte_incidencia,model_hgt_soporte_incidencia,,1,1,1,1
access_hgt_soporte_estado,access_hgt_soporte_estado,model_hgt_soporte_estado,,1,1,1,1
\ No newline at end of file \ No newline at end of file
<openerp>
<data>
<record model="ir.module.category" id="category_hgt_soporteincidencias">
<field name="name">Soporte Incidentes</field>
<field name="description">Soporte Incidentes</field>
</record>
<record model="res.groups" id="group_soporte_general">
<field name="name">Lista de incidentes</field>
<field name="category_id" eval="ref('category_hgt_soporteincidencias')"/>
</record>
<record model="res.groups" id="group_soporte_configurador">
<field name="name">Configurador</field>
<field name="category_id" eval="ref('category_hgt_soporteincidencias')"/>
</record>
</data>
</openerp>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<record id="action_soporteincidencias_act_window" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Incidencias</field>
<field name="res_model">hgt.soporte_incidencia</field>
<field name="view_mode">tree,form</field>
<field name="domain">[["si_responsable","=",uid]]</field>
<field name="view_type">form</field>
<field name="target">current</field>
</record>
<record id="action_soporteincidenciasconfig_act_window" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Incidencias</field>
<field name="res_model">hgt.soporte_incidencia</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="target">current</field>
</record>
<record id="view_soporteincidencias_tree" model="ir.ui.view">
<field name="name">Incidencias</field>
<field name="model">hgt.soporte_incidencia</field>
<field name="type">tree</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<tree>
<field name="si_numero" />
<field name="si_ost_asunto" />
<field name="si_fecha"/>
<field name="si_url" widget="url"/>
<field name="si_descripcion"/>
</tree>
</field>
</record>
<record id="view_soporteincidencias_form" model="ir.ui.view">
<field name="name">Incidencias</field>
<field name="model">hgt.soporte_incidencia</field>
<field name="type">form</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<form>
<!--<sheet>-->
<group col="4" string="Incidencia">
<field colspan="2" name="si_fecha"/>
<field colspan="2" name="si_estado"/>
</group>
<group col="4">
<field colspan="2" name="si_responsabilidad"/>
</group>
<h2>Osticket</h2>
<group col="2">
<field name="si_url" widget="url"/>
<field name="si_numero" />
<field name="si_ost_cliente" />
</group>
<group col="4">
<field name="si_ost_mail" />
<field name="si_ost_telefeno" />
</group>
<group col="1">
<h2>Asunto</h2>
<field name="si_ost_asunto" nolabel="1"/>
<h2>Descripcion</h2>
<field name="si_descripcion" nolabel="1"/>
<h2>Mensajes</h2>
<field name="si_ost_mensaje" nolabel="1"/>
</group>
<!--</sheet>-->
</form>
</field>
</record>
</data>
</odoo>
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<!-- Elemento Root -->
<menuitem name="Soporte" sequence='10' id="hgt_soporte_soporte"/>
<!-- Elemento Grupe -->
<menuitem name="Incidencias Propias" sequence="10" id="hgt_soporte_incidencias_propias" parent="hgt_soporte_soporte"/>
<menuitem name="Representante Técnico" sequence="20" id="hgt_soporte_representante_tecnico" parent="hgt_soporte_soporte"/>
<menuitem name="Incidencias"
sequence="10"
id="hgt_soporte_incidencias_propias_incidencias"
parent="hgt_soporte_incidencias_propias"
action="action_soporteincidencias_act_window"
groups="group_soporte_general,group_soporte_configurador"/>
<menuitem name="Incidencias"
sequence="10"
id="hgt_soporte_representante_tecnico_incidencias"
parent="hgt_soporte_representante_tecnico"
action="action_soporteincidenciasconfig_act_window"
groups="group_soporte_configurador"/>
</data>
</odoo>
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!