Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
hgt_soporte
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 50c8b78b
authored
2022-11-27 14:13:16 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Empieso a trabajar subida de incidencias
1 parent
45c5688d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
models/incidencia.py
models/incidencia.py
View file @
50c8b78
...
...
@@ -11,6 +11,7 @@ TokensValidos = [
"retbgv,opervbtolsdfhgtr,wfrrwegf,te,hthrjyqwwqefwer57e74fwtgreñloewwefcd,{sdafsdasdffw6"
,
"asdASFefcECWÑlfweñ324dcfwcfdwefcñfdwqecwedfñfc43fd.dfqwe,dfweqf3cvbtr.LDSFsdfsaewfvresf"
,
]
HgtUrlBase
=
"""https://validacion.hgtsa.com.ar/"""
class
hgt_soporte_incidencia
(
models
.
Model
):
_name
=
'hgt.soporte_incidencia'
...
...
@@ -132,27 +133,33 @@ class hgt_soporte_incidencia(models.Model):
def
enviarIncidencia
(
self
):
#funcion para la creacion de incidencias en modulo incidencias
self
.
subida
=
True
#
self.subida = True
URL
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
search
([(
'key'
,
'='
,
'web.base.url'
)])
URL
=
str
(
URL
.
value
)
URL_local
=
str
(
URL
.
value
)
database
=
self
.
env
.
cr
.
dbname
datos
=
{
'params'
:
{
'token'
:
"""a2354mtrgre3456783edfghoiuhEDSfvwerd-5644-fgdh34ergdf"""
,
'
in
_fecha'
:
self
.
si_fecha
,
'name'
:
self
.
si_name
,
'descripcion'
:
self
.
si_descripcion
,
'params'
:
{
'token'
:
self
.
GenerarToken
()
,
'
si
_fecha'
:
self
.
si_fecha
,
'
si_
name'
:
self
.
si_name
,
'
si_
descripcion'
:
self
.
si_descripcion
,
'in_id_si'
:
self
.
id
,
'cliente_URL'
:
URL
,
'cliente_URL'
:
URL_local
,
'database'
:
database
}
}
datos_json
=
json
.
dumps
(
datos
)
#print(datos_json)
f
=
requests
.
post
(
URL
+
'/incidencias/crear'
,
data
=
datos_json
,
headers
=
headers
)
f
=
requests
.
post
(
f
"{HgtUrlBase}soporteIncidencias/crear"
,
data
=
datos_json
,
headers
=
headers
)
frespuesta
=
f
.
json
()
raise
UserError
(
str
(
frespuesta
))
#en frespuesta tengo el id de la incidencia creada en el otro modulo
self
.
si_id_in
=
frespuesta
#
self.si_id_in = frespuesta
#("entro a enviar incidencia y ahora el valor de ella es " + str(self.subida))
#print(frespuesta)
...
...
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