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 607b8641
authored
2022-11-28 09:51:17 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
cierre de incidencias
1 parent
83db0158
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
models/incidencia.py
views/incidencia_view.xml
models/incidencia.py
View file @
607b864
...
...
@@ -199,6 +199,39 @@ class hgt_soporte_incidencia(models.Model):
'target'
:
'new'
,
}
def
CerrarIncidencia
(
self
):
self
.
estado
=
"cerrada"
if
self
.
subida
:
self
.
CerradoRemoto
()
def
CerradoRemoto
(
self
):
"""En caso de cerrar la incidencia y es remota si informa al
server, en el otro extremo se sobreeescribe para cierre
en cliente"""
database
=
self
.
env
.
cr
.
dbname
datos
=
{
'params'
:
{
'token'
:
self
.
GenerarToken
(),
'si_fecha'
:
self
.
si_fecha
,
'si_name'
:
self
.
si_name
,
'si_descripcion'
:
self
.
si_descripcion
,
'in_id_si'
:
self
.
id
,
'database'
:
database
,
'usuario'
:
self
.
si_responsable
.
display_name
,
'estado'
:
"cerrada"
,
}
}
datos_json
=
json
.
dumps
(
datos
)
#print(datos_json)
f
=
requests
.
post
(
f
"{HgtUrlBase}soporteIncidencias/crear"
,
data
=
datos_json
,
headers
=
headers
)
frespuesta
=
f
.
json
()
if
frespuesta
[
"result"
][
"estado"
]
!=
"ok"
:
raise
UserError
(
str
(
frespuesta
))
#print(hgt_soporte_incidencia.GenerarToken())
# si_url = fields.Char(string='Url de ticketera')
...
...
views/incidencia_view.xml
View file @
607b864
...
...
@@ -56,6 +56,7 @@
<header>
<button
type=
"object"
name=
"enviarIncidencia"
string=
"Abrir y Notificar a HGT"
attrs=
"{ 'invisible' :[('subida','=', True)] }"
class=
"oe_highlight"
/>
<button
name=
"AbrirLocal"
class=
"btn btn-success"
string=
"Abrir Incidencia local"
type=
"object"
attrs=
"{ 'invisible' :[('estado','!=', 'borrador')] }"
/>
<button
name=
"CerrarIncidencia"
class=
"btn btn-danger"
string=
"Cerrar incidencia"
type=
"object"
attrs=
"{ 'invisible' :[('estado','in', ['borrador','cerrada'])] }"
/>
<field
name=
"estado"
widget=
"statusbar"
readonly=
"1"
/>
<field
name=
"si_cerrada"
invisible=
"1"
/>
</header>
...
...
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