Commit 560f9b91 by juan

Modulo para hgt

1 parent eff637f9
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
# always loaded # always loaded
'data': [ 'data': [
# 'security/ir.model.access.csv', 'security/permisos.xml',
'security/ir.model.access.csv',
'views/incidencias.xml', 'views/incidencias.xml',
'views/menu.xml', 'views/menu.xml',
......
...@@ -31,9 +31,16 @@ class hgt_incidencias(models.Model): ...@@ -31,9 +31,16 @@ class hgt_incidencias(models.Model):
numero = fields.Char(string='Numero de ticket') numero = fields.Char(string='Numero de ticket')
_sql_constraints = [('id_ost_uniq', 'unique (id_ost)', 'Id Ticket must be unique.')]
id_ost = fields.Integer(string='Id osticket') id_ost = fields.Integer(string='Id osticket')
ost_cliente = fields.Char(string='Ost cliente')
ost_asunto = fields.Char(string='Ost asunto')
ost_mail = fields.Char(string='Ost mail')
ost_telefeno = fields.Char(string='Ost telefono')
fecha_creacion = fields.Date( fecha_creacion = fields.Date(
string=u'Fecha de creación', string=u'Fecha de creación',
...@@ -81,16 +88,17 @@ class hgt_incidencias(models.Model): ...@@ -81,16 +88,17 @@ class hgt_incidencias(models.Model):
iden= cant + 1 iden= cant + 1
datos = { datos = {
'resumen':'Tarea para resolver Incidencia {}'.format(iden), 'resumen':'Incidencia {} {}'.format(iden, vals['ost_asunto']),
'descripcion': vals['descripcion'] 'descripcion': vals['descripcion']
} }
nueva_tar = self.env['hgt.tarea'].create(datos) nueva_tar = self.env['hgt.tarea'].create(datos)
try:
if vals['accion']: if vals['accion']:
accion = vals['accion'] accion = vals['accion']
acc = self.env['hgt.acciones'].search([('id','=',accion)]) acc = self.env['hgt.acciones'].search([('id','=',accion)])
acc.tareas = [(4,nueva_tar.id)] acc.tareas = [(4,nueva_tar.id)]
except:
pass
vals['tarea'] = nueva_tar.id vals['tarea'] = nueva_tar.id
result = super(hgt_incidencias, self).create(vals) result = super(hgt_incidencias, self).create(vals)
return result return result
......
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_my_module_my_module,my_module.my_module,model_my_module_my_module,group_crm_incidentes,1,1,1,0
\ No newline at end of file \ No newline at end of file
access_hgt_incidencias,access_hgt_incidencias,model_hgt_incidencias,group_crm_incidentes,1,1,1,0
\ No newline at end of file \ No newline at end of file
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
<field name="active" eval="True" /> <field name="active" eval="True" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree> <tree>
<field name="numero" />
<field name="ost_asunto" />
<field name="fecha_creacion"/> <field name="fecha_creacion"/>
<field name="estado"/> <field name="url" widget="url"/>
<field name="responsabilidad"/>
<field name="descripcion"/> <field name="descripcion"/>
</tree> </tree>
</field> </field>
...@@ -47,20 +48,33 @@ ...@@ -47,20 +48,33 @@
<field colspan="2" name="responsabilidad"/> <field colspan="2" name="responsabilidad"/>
<field colspan="2" name="cliente"/> <field colspan="2" name="cliente"/>
</group> </group>
<h2>Osticket</h2>
<group col="2">
<field name="url" widget="url"/>
<field name="numero" />
<field name="ost_cliente" />
</group>
<group col="4">
<field name="ost_mail" />
<field name="ost_telefeno" />
</group>
<group col="1">
<h2>Asunto</h2>
<field name="ost_asunto" nolabel="1"/>
<h2>Descripcion</h2>
<field name="descripcion" nolabel="1"/>
</group>
<notebook> <notebook>
<page string="Descripción"> <page string="Tareas">
<field name="descripcion" nolabel="1"/>
</page>
<page string="Reporte">
<field name="reporte" nolabel="1"/>
</page>
<page string="Tarea">
<group col="4"> <group col="4">
<field name="proyecto" colspan="2" /> <field name="proyecto" colspan="2" />
<field name="accion" colspan="2"/> <field name="accion" colspan="2"/>
<field name="tarea" colspan="2" readonly="1"/> <field name="tarea" colspan="2" readonly="1"/>
</group> </group>
</page> </page>
<page string="Reporte">
<field name="reporte" nolabel="1"/>
</page>
</notebook> </notebook>
</sheet> </sheet>
</form> </form>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!