Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
hgt_liquidacion_tareas
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 cc27b390
authored
2021-01-14 12:43:05 -0300
by
Maria Agustina
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
correcciones
1 parent
65251d68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
3 deletions
models/__pycache__/liquidacionestareas.cpython-36.pyc
models/__pycache__/master.cpython-36.pyc
models/liquidacionestareas.py
models/master.py
views/vista_maestro.xml
models/__pycache__/liquidacionestareas.cpython-36.pyc
View file @
cc27b39
No preview for this file type
models/__pycache__/master.cpython-36.pyc
View file @
cc27b39
No preview for this file type
models/liquidacionestareas.py
View file @
cc27b39
...
...
@@ -81,13 +81,15 @@ class hdgt_liquidacionestareas(models.Model):
#import ipdb; ipdb.set_trace()
tareas
=
self
.
env
[
'hgt.tarea'
]
.
search
([(
'ejecutor'
,
'='
,
usuario
),(
'write_date'
,
'>'
,
desde1
),(
'write_date'
,
'<'
,
hasta1
)])
puesto
=
self
.
env
[
'hgt.tipo_cargo'
]
.
search
([(
'ejecutores'
,
'='
,
usuario
)],
limit
=
1
)
for
tarea
in
tareas
.
ids
:
nva_lin
=
self
.
env
[
'hgt.linea_tarea'
]
.
create
({
'tarea'
:
tarea
,
'liquidaciones'
:
liquidacion
,
'inicio'
:
desde
,
'cierre'
:
hasta
,
'tipo_cargo'
:
puesto
.
id
,
})
return
len
(
tareas
)
...
...
@@ -124,5 +126,16 @@ class hdgt_liquidacionestareas(models.Model):
obj
=
self
.
env
.
ref
(
'hgt_liquidacion_tareas.reporte_liquidaciones'
)
.
report_action
(
self
)
return
obj
def
ver_liquidacion
(
self
):
return
{
'type'
:
'ir.actions.act_window'
,
'name'
:
'Model Title'
,
'view_type'
:
'form'
,
'view_mode'
:
'form'
,
'res_model'
:
'hgt.liquidacionestareas'
,
'res_id'
:
self
.
id
,
'target'
:
'current'
,
}
models/master.py
View file @
cc27b39
...
...
@@ -44,12 +44,13 @@ class hgt_masterliquidaciones(models.Model):
'hasta'
:
self
.
hasta
,
'estado'
:
'borrador'
,
}
nva_liq
=
self
.
env
[
'hgt.liquidacionestareas'
]
.
create
(
datos
)
self
.
liquidaciones
=
[(
4
,
nva_liq
.
id
)]
if
self
.
liquidaciones
.
crear_linea
(
nva_liq
.
id
,
ejecutor
.
id
,
self
.
desde
,
self
.
hasta
)
==
0
:
raise
UserError
(
'No hay tareas que liquidar en el período de tiempo seleccionado'
)
...
...
views/vista_maestro.xml
View file @
cc27b39
...
...
@@ -53,7 +53,17 @@
<field
colspan=
"2"
nolabel=
"1"
name=
"ejecutores"
widget=
"many2many_tags"
/>
</group>
<group
col=
"2"
string=
"Liquidaciones"
>
<field
colspan=
"2"
nolabel=
"1"
name=
"liquidaciones"
/>
<field
colspan=
"2"
nolabel=
"1"
name=
"liquidaciones"
>
<tree
create=
"0"
edit=
"0"
editable=
"0"
>
<field
name=
"nombre"
readonly=
"1"
/>
<field
name=
"desde"
readonly=
"1"
/>
<field
name=
"hasta"
readonly=
"1"
/>
<field
name=
"estado"
readonly=
"1"
/>
<field
name=
"total"
readonly=
"1"
/>
<field
name=
"abonado"
readonly=
"1"
/>
<button
name=
"ver_liquidacion"
class=
'btn btn-primary'
string=
"Ir"
type=
"object"
/>
</tree>
</field>
</group>
</sheet>
</form>
...
...
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