Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
hgt_cobranzas
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 97f70a68
authored
2021-05-31 11:56:08 -0300
by
Maria Agustina
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
avance logica
1 parent
e53e0a2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
16 deletions
models/__pycache__/cobros.cpython-36.pyc
models/__pycache__/intereses.cpython-36.pyc
models/__pycache__/linea_deuda.cpython-36.pyc
models/cobros.py
models/intereses.py
models/linea_deuda.py
views/cobros.xml
models/__pycache__/cobros.cpython-36.pyc
View file @
97f70a6
No preview for this file type
models/__pycache__/intereses.cpython-36.pyc
View file @
97f70a6
No preview for this file type
models/__pycache__/linea_deuda.cpython-36.pyc
View file @
97f70a6
No preview for this file type
models/cobros.py
View file @
97f70a6
...
@@ -8,13 +8,15 @@ class vnt_cobros(models.Model):
...
@@ -8,13 +8,15 @@ class vnt_cobros(models.Model):
co_cliente
=
fields
.
Many2one
(
co_cliente
=
fields
.
Many2one
(
string
=
'Cliente'
,
string
=
'Cliente'
,
comodel_name
=
'
hgt.instituciones
'
,
comodel_name
=
'
asw.cliente
'
,
)
)
co_lin_deuda
=
fields
.
One2many
(
co_lin_deuda
=
fields
.
One2many
(
string
=
u"Línea Deuda"
,
string
=
u"Línea Deuda"
,
comodel_name
=
'vnt.linea_deuda'
,
comodel_name
=
'vnt.linea_deuda'
,
inverse_name
=
'ld_cobros'
,
inverse_name
=
'ld_cobros'
,
compute
=
'_onchange_ld'
,
inverse
=
'_inverse_onchange_ld'
,
)
)
co_resumen
=
fields
.
Text
(
co_resumen
=
fields
.
Text
(
...
@@ -53,6 +55,22 @@ class vnt_cobros(models.Model):
...
@@ -53,6 +55,22 @@ class vnt_cobros(models.Model):
for
record
in
self
:
for
record
in
self
:
record
.
co_total
=
record
.
co_total_deuda
+
record
.
co_total_interes
record
.
co_total
=
record
.
co_total_deuda
+
record
.
co_total_interes
@api.onchange
(
'co_cliente'
)
def
_onchange_ld
(
self
):
lista
=
[]
#recupero comprobantes de venta, adeudados, con el cliente seleccionado
comp_venta_adeud
=
self
.
env
[
'asw.comprobante'
]
.
search
([(
'comp_talonario.tal_menu'
,
'='
,
'fac'
),(
'comp_tipo_comp'
,
'='
,
'e'
),
(
'comp_estado'
,
'='
,
'a'
),
(
'comp_cliente'
,
'='
,
self
.
co_cliente
.
id
)])
for
comp
in
comp_venta_adeud
:
nva_linea
=
self
.
env
[
'vnt.linea_deuda'
]
.
create
({
'ld_factura'
:
comp
.
id
,
})
lista
.
append
(
nva_linea
.
id
)
self
.
co_lin_deuda
=
lista
def
_inverse_onchange_ld
(
self
):
return
True
models/intereses.py
View file @
97f70a6
...
@@ -8,7 +8,7 @@ class vnt_interes(models.Model):
...
@@ -8,7 +8,7 @@ class vnt_interes(models.Model):
int_cliente
=
fields
.
Many2many
(
int_cliente
=
fields
.
Many2many
(
string
=
u"Clientes"
,
string
=
u"Clientes"
,
comodel_name
=
'
hgt.instituciones
'
,
comodel_name
=
'
asw.cliente
'
,
relation
=
"interes_clientes"
,
relation
=
"interes_clientes"
,
)
)
...
...
models/linea_deuda.py
View file @
97f70a6
...
@@ -57,7 +57,6 @@ class vnt_linea_deuda(models.Model):
...
@@ -57,7 +57,6 @@ class vnt_linea_deuda(models.Model):
string
=
'Nota Débito'
,
string
=
'Nota Débito'
,
comodel_name
=
'asw.comprobante'
,
comodel_name
=
'asw.comprobante'
,
ondelete
=
'restrict'
,
ondelete
=
'restrict'
,
required
=
True
,
)
)
ld_cobros
=
fields
.
Many2one
(
ld_cobros
=
fields
.
Many2one
(
...
@@ -72,13 +71,13 @@ class vnt_linea_deuda(models.Model):
...
@@ -72,13 +71,13 @@ class vnt_linea_deuda(models.Model):
for
record
in
self
:
for
record
in
self
:
record
.
ld_total
=
record
.
ld_factura
.
comp_total
record
.
ld_total
=
record
.
ld_factura
.
comp_total
#
dominio p elegir solo facturas de venta
#
#dominio p elegir solo facturas de venta, queda obsoleto pq las lineas se generaran en otra fx
@api.onchange
(
'ld_factura'
)
#
@api.onchange('ld_factura')
def
onchange_ld_factura
(
self
):
#
def onchange_ld_factura(self):
result
=
{}
#
result = {}
result
[
'domain'
]
=
[]
#
result['domain'] = []
comp_venta_em
=
self
.
env
[
'asw.comprobante'
]
.
search
([(
'comp_talonario.tal_menu'
,
'='
,
'fac'
),(
'comp_tipo_comp'
,
'='
,
'e'
)])
#
comp_venta_em = self.env['asw.comprobante'].search([('comp_talonario.tal_menu','=','fac'),('comp_tipo_comp','=','e')])
result
[
'domain'
]
=
{
'ld_factura'
:
[(
'id'
,
'in'
,
comp_venta_em
.
ids
)]}
#
result['domain'] = {'ld_factura' : [('id', 'in', comp_venta_em.ids)]}
return
result
#
return result
views/cobros.xml
View file @
97f70a6
...
@@ -46,11 +46,11 @@
...
@@ -46,11 +46,11 @@
<notebook
colspan=
"4"
>
<notebook
colspan=
"4"
>
<page
string=
"Deudas"
>
<page
string=
"Deudas"
>
<field
nolabel=
"1"
name=
"co_lin_deuda"
>
<field
nolabel=
"1"
name=
"co_lin_deuda"
>
<tree
create=
"
1
"
edit=
"1"
editable=
"1"
>
<tree
create=
"
0
"
edit=
"1"
editable=
"1"
>
<field
name=
"ld_factura"
/>
<field
name=
"ld_factura"
readonly=
"1"
/>
<field
name=
"ld_fecha_vto"
/>
<field
name=
"ld_fecha_vto"
readonly=
"1"
/>
<field
name=
"ld_estado"
/>
<field
name=
"ld_estado"
readonly=
"1"
/>
<field
name=
"ld_total"
/>
<field
name=
"ld_total"
readonly=
"1"
/>
<!-- <field name="ld_fecha_vto" editable="0" readonly="1" />
<!-- <field name="ld_fecha_vto" editable="0" readonly="1" />
<field name="ld_estado" editable="0" readonly="1" />
<field name="ld_estado" editable="0" readonly="1" />
<field name="ld_total" readonly="1" /> -->
<field name="ld_total" readonly="1" /> -->
...
...
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