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 cd2ca6f4
authored
2021-01-29 18:49:32 -0300
by
adrian
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Mejora en tareas
1 parent
8ce12e45
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
4 deletions
models/incidencias.py
views/incidencias.xml
models/incidencias.py
View file @
cd2ca6f
...
...
@@ -62,6 +62,13 @@ class hgt_incidencias(models.Model):
ondelete
=
'restrict'
,
)
tareas
=
fields
.
Many2many
(
comodel_name
=
'hgt.tarea'
,
relation
=
"tareas_incidente"
,
string
=
'Tareas derivadas'
,
)
proyecto
=
fields
.
Many2one
(
string
=
'Proyecto'
,
comodel_name
=
'hgt.proyecto'
,
...
...
@@ -74,6 +81,36 @@ class hgt_incidencias(models.Model):
ondelete
=
'restrict'
,
)
texto_descripcion
=
fields
.
Html
(
string
=
'Texto descripcion de la tarea'
)
asignador
=
fields
.
Many2one
(
comodel_name
=
'res.users'
,
string
=
'Ejecuta'
)
abrir
=
fields
.
Boolean
(
string
=
'Abrir al crear'
,
default
=
False
)
tiempo_carga
=
fields
.
Integer
(
string
=
'Tiempo utilizado'
,
default
=
30
)
def
generar_tareas
(
self
):
iden
=
self
.
id
datos
=
{
'resumen'
:
'Incidencia {} {}'
.
format
(
iden
,
self
.
ost_asunto
),
'descripcion'
:
self
.
texto_descripcion
,
'ejecutor'
:
self
.
asignador
.
id
,
'minutos_reales'
:
self
.
tiempo_carga
}
nueva_tar
=
self
.
env
[
'hgt.tarea'
]
.
create
(
datos
)
self
.
asignador
=
False
self
.
texto_descripcion
=
False
self
.
tareas
=
[(
4
,
nueva_tar
.
id
,
0
)]
self
.
tiempo_carga
=
30
if
self
.
abrir
==
True
:
return
{
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'hgt.tarea'
,
'views'
:
((
False
,
'form'
),
(
False
,
'tree'
)),
'res_id'
:
nueva_tar
.
id
,
'domain'
:
[(
'field'
,
'='
,
'value'
)],
}
@api.onchange
(
'proyecto'
)
def
onchange_campo
(
self
):
result
=
{}
...
...
@@ -87,8 +124,9 @@ class hgt_incidencias(models.Model):
@api.model
def
create
(
self
,
vals
):
dom
=
[]
cant
=
self
.
env
[
'hgt.incidencias'
]
.
search_count
(
dom
)
iden
=
cant
+
1
#cant = self.env['hgt.incidencias'].search_count(dom)
#iden= cant + 1
idem
=
self
.
id
datos
=
{
'resumen'
:
'Incidencia {} {}'
.
format
(
iden
,
vals
[
'ost_asunto'
]),
...
...
views/incidencias.xml
View file @
cd2ca6f
...
...
@@ -39,7 +39,7 @@
<field
name=
"active"
eval=
"True"
/>
<field
name=
"arch"
type=
"xml"
>
<form>
<
sheet
>
<
!--<sheet>--
>
<group
col=
"4"
string=
"Incidencia"
>
<field
colspan=
"2"
name=
"fecha_creacion"
/>
<field
colspan=
"2"
name=
"estado"
/>
...
...
@@ -76,11 +76,25 @@
<field
name=
"tarea"
colspan=
"2"
readonly=
"1"
/>
</group>
</page>
<page
string=
"Tareas delegadas"
>
<button
type=
"object"
name=
"generar_tareas"
string=
"Generar Tareas"
/>
<h2>
Descripcion de la tarea
</h2>
<group
col=
"1"
>
<field
name=
"texto_descripcion"
nolabel=
"1"
/>
</group>
<group
col=
"6"
>
<field
name=
"tiempo_carga"
colspan=
"2"
/>
<field
name=
"abrir"
widget=
"boolean_toggle"
/>
<field
name=
"asignador"
colspan=
"2"
/>
</group>
<field
name=
"tareas"
nolabel=
"1"
/>
</page>
<page
string=
"Reporte"
>
<field
name=
"reporte"
nolabel=
"1"
/>
</page>
</notebook>
<
/sheet
>
<
!--</sheet>--
>
</form>
</field>
</record>
...
...
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