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 8ce12e45
authored
2021-01-16 23:19:06 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
integracionmensajes
1 parent
560f9b91
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
32 deletions
models/incidencias.py
views/incidencias.xml
models/incidencias.py
View file @
8ce12e4
...
@@ -4,6 +4,7 @@ from odoo import models, fields, api
...
@@ -4,6 +4,7 @@ from odoo import models, fields, api
import
requests
import
requests
class
hgt_incidencias
(
models
.
Model
):
class
hgt_incidencias
(
models
.
Model
):
_name
=
'hgt.incidencias'
_name
=
'hgt.incidencias'
_order
=
"id desc"
responsabilidad
=
fields
.
Selection
(
responsabilidad
=
fields
.
Selection
(
string
=
u'Responsabilidad'
,
string
=
u'Responsabilidad'
,
...
@@ -42,6 +43,8 @@ class hgt_incidencias(models.Model):
...
@@ -42,6 +43,8 @@ class hgt_incidencias(models.Model):
ost_telefeno
=
fields
.
Char
(
string
=
'Ost telefono'
)
ost_telefeno
=
fields
.
Char
(
string
=
'Ost telefono'
)
ost_mensaje
=
fields
.
Text
(
string
=
'Mensajes'
)
fecha_creacion
=
fields
.
Date
(
fecha_creacion
=
fields
.
Date
(
string
=
u'Fecha de creación'
,
string
=
u'Fecha de creación'
,
default
=
fields
.
Date
.
context_today
,
default
=
fields
.
Date
.
context_today
,
...
@@ -104,38 +107,19 @@ class hgt_incidencias(models.Model):
...
@@ -104,38 +107,19 @@ class hgt_incidencias(models.Model):
return
result
return
result
def
importarRango
(
self
,
key
,
inicio
,
final
):
def
mensajes_ost
(
self
,
val
):
idticket
=
1
#print(val[0])
ultimo
=
5000
dom
=
[[
"numero"
,
"="
,
val
[
0
]]]
while
idticket
<=
ultimo
:
ins
=
self
.
env
[
'hgt.incidencias'
]
.
search
(
dom
,
limit
=
1
)
existe
=
self
.
env
[
'asw.ticket'
]
.
search_count
([(
'tic_id_externo'
,
'='
,
idticket
)])
if
len
(
ins
)
==
0
:
if
existe
==
False
:
#print("no esta en sistemma")
link
=
'http://192.168.10.17:11876/get-info?id-tk='
+
str
(
idticket
)
+
'&api-key='
+
key
return
(
True
)
info
=
requests
.
get
(
link
)
.
json
()
text_orig
=
ins
.
ost_mensaje
if
'message'
in
info
and
info
[
'message'
]
==
'Internal Server Error'
:
texto_nuevo
=
"""
\n
{} {} {}
\n
{}
\n\n
#######################################################
\n
"""
.
format
(
val
[
1
],
val
[
2
],
val
[
4
],
val
[
3
])
idticket
+=
1
Texto
=
"""{}
\n
{}"""
.
format
(
text_orig
,
texto_nuevo
)
else
:
#print(Texto)
datos
=
{
ins
.
ost_mensaje
=
Texto
'tic_id_externo'
:
idticket
,
return
(
True
)
'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
...
...
views/incidencias.xml
View file @
8ce12e4
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<field
name=
"ost_asunto"
/>
<field
name=
"ost_asunto"
/>
<field
name=
"fecha_creacion"
/>
<field
name=
"fecha_creacion"
/>
<field
name=
"url"
widget=
"url"
/>
<field
name=
"url"
widget=
"url"
/>
<field
colspan=
"2"
name=
"cliente"
/>
<field
name=
"descripcion"
/>
<field
name=
"descripcion"
/>
</tree>
</tree>
</field>
</field>
...
@@ -63,7 +64,10 @@
...
@@ -63,7 +64,10 @@
<field
name=
"ost_asunto"
nolabel=
"1"
/>
<field
name=
"ost_asunto"
nolabel=
"1"
/>
<h2>
Descripcion
</h2>
<h2>
Descripcion
</h2>
<field
name=
"descripcion"
nolabel=
"1"
/>
<field
name=
"descripcion"
nolabel=
"1"
/>
<h2>
Mensajes
</h2>
<field
name=
"ost_mensaje"
nolabel=
"1"
/>
</group>
</group>
<notebook>
<notebook>
<page
string=
"Tareas"
>
<page
string=
"Tareas"
>
<group
col=
"4"
>
<group
col=
"4"
>
...
...
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