Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
hgt_incidencias
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit eff637f9
authored
2021-01-16 09:18:29 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
cambios generales
1 parent
df0046d3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
6 deletions
models/incidencias.py
security/ir.model.access.csv
security/permisos.xml
views/menu.xml
models/incidencias.py
View file @
eff637f
# -*- coding: utf-8 -*-
from
odoo
import
models
,
fields
,
api
import
requests
class
hgt_incidencias
(
models
.
Model
):
_name
=
'hgt.incidencias'
...
...
@@ -20,14 +20,21 @@ class hgt_incidencias(models.Model):
cliente
=
fields
.
Many2one
(
string
=
'Cliente'
,
comodel_name
=
'hgt.cliente'
,
ondelete
=
'restrict'
,
comodel_name
=
'hgt.instituciones'
,
)
descripcion
=
fields
.
Html
(
string
=
u'Descripción'
,
)
url
=
fields
.
Char
(
string
=
'Url de ticketera'
)
numero
=
fields
.
Char
(
string
=
'Numero de ticket'
)
id_ost
=
fields
.
Integer
(
string
=
'Id osticket'
)
fecha_creacion
=
fields
.
Date
(
string
=
u'Fecha de creación'
,
default
=
fields
.
Date
.
context_today
,
...
...
@@ -89,6 +96,40 @@ class hgt_incidencias(models.Model):
return
result
def
importarRango
(
self
,
key
,
inicio
,
final
):
idticket
=
1
ultimo
=
5000
while
idticket
<=
ultimo
:
existe
=
self
.
env
[
'asw.ticket'
]
.
search_count
([(
'tic_id_externo'
,
'='
,
idticket
)])
if
existe
==
False
:
link
=
'http://192.168.10.17:11876/get-info?id-tk='
+
str
(
idticket
)
+
'&api-key='
+
key
info
=
requests
.
get
(
link
)
.
json
()
if
'message'
in
info
and
info
[
'message'
]
==
'Internal Server Error'
:
idticket
+=
1
else
:
datos
=
{
'tic_id_externo'
:
idticket
,
'tic_asunto'
:
info
[
'asunto'
],
'tic_cacilla'
:
info
[
'cacilla'
],
'tic_cliente'
:
info
[
'cliente'
],
'tic_resumen'
:
info
[
'cuerpo'
],
'tic_departamento'
:
info
[
'departamento'
],
'tic_estado'
:
info
[
'estado'
],
'tic_numero'
:
info
[
'numero'
],
'tic_mail'
:
info
[
'reporto'
],
}
link2
=
'http://192.168.10.17:11876/get-client?id-t='
+
str
(
idticket
)
+
'&api-key='
+
key
info2
=
requests
.
get
(
link2
)
.
json
()
if
'message'
in
info2
and
info2
[
'message'
]
==
'Internal Server Error'
:
self
.
env
[
'asw.ticket'
]
.
create
(
datos
)
idticket
+=
1
else
:
datos
[
'tic_notas'
]
=
info2
[
'notas'
]
datos
[
'tic_telefono'
]
=
info2
[
'telefono'
]
self
.
env
[
'asw.ticket'
]
.
create
(
datos
)
idticket
+=
1
...
...
security/ir.model.access.csv
View file @
eff637f
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,,1,0,0,0
\ No newline at end of file
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
security/permisos.xml
0 → 100644
View file @
eff637f
<openerp>
<data>
<record
model=
"ir.module.category"
id=
"category_hgt_incidente"
>
<field
name=
"name"
>
CRM Incidentes
</field>
<field
name=
"description"
>
CRM Incidentes
</field>
</record>
<record
model=
"res.groups"
id=
"group_crm_incidentes"
>
<field
name=
"name"
>
Lista de incidentes
</field>
<field
name=
"category_id"
eval=
"ref('category_hgt_incidente')"
/>
</record>
</data>
</openerp>
\ No newline at end of file
views/menu.xml
View file @
eff637f
...
...
@@ -2,8 +2,9 @@
<odoo>
<data
noupdate=
"0"
>
<menuitem
name=
"Incidencias"
id=
"hgt_incidencias"
/>
<menuitem
name=
"Incidencias"
id=
"hgt_incidencias_incidencias"
parent=
"hgt_incidencias"
/>
<!--<menuitem name="Incidencias" id="hgt_incidencias" />-->
<menuitem
name=
"Incidencias"
id=
"hgt_incidencias_incidencias"
parent=
"asw_crm.asw_crm_root"
/>
<menuitem
name=
"Ver Incidencias"
parent=
"hgt_incidencias_incidencias"
id=
"hgt_incidencias_accion"
action=
"action_incidencias_act_window"
/>
</data>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment