Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
tpv_correcciones
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 450bb317
authored
2021-03-17 16:59:30 -0300
by
adrian
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
A productivo
1 parent
84fe9778
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
16 deletions
.gitignore
models/comprobante.py
views/comprobante.xml
wizard/prod_pfinal.py
.gitignore
0 → 100644
View file @
450bb31
*.pyc
models/comprobante.py
View file @
450bb31
...
...
@@ -99,4 +99,7 @@ class asw_comprobante(models.Model):
'target'
:
'new'
,
}
def
recalcularTotal
(
self
):
self
.
_onchange_comp_linea_facturas
()
views/comprobante.xml
View file @
450bb31
...
...
@@ -7,7 +7,8 @@
<field
name=
"arch"
type=
"xml"
>
<data>
<xpath
expr=
"//button[@name='validar']"
position=
"before"
>
<button
name=
"abrir_wizard_ppf"
class=
'btn btn-primary'
string=
"+ Producto por precio final"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
<button
name=
"abrir_wizard_ppf"
class=
'btn btn-success'
string=
"+ Producto por precio final"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
<button
name=
"recalcularTotal"
class=
'btn btn-warning'
string=
"Recalcular Monto"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
</xpath>
<xpath
expr=
"//group[1]"
position=
"after"
>
<group
string=
"Referencias"
col=
"2"
>
...
...
@@ -18,7 +19,7 @@
</data>
</field>
</record>
<!--
<record
id=
"view_form_inherit_comprobante_ui"
model=
"ir.ui.view"
>
<field
name=
"name"
>
Comprobante
</field>
<field
name=
"model"
>
asw.comprobante
</field>
...
...
@@ -26,19 +27,14 @@
<field
name=
"arch"
type=
"xml"
>
<data>
<xpath expr="//button[@name='imprimir']" position="before">
<button name="abrir_wizard_ppf" class='btn btn-primary' string="+ Producto por precio final" type="object" attrs="{'invisible':[('comp_estado','!=','b')]}"/>
</xpath>
<xpath expr="//group[1]" position="after">
<group string="Referencia" col="2">
<field name="referencia_corr" colspan="1" nolabel="1" widget="many2many_tags" />
</group>
<xpath
expr=
"//button[@name='validar']"
position=
"after"
>
<button
name=
"abrir_wizard_ppf"
class=
'btn btn-success'
string=
"+ Producto por precio final"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
<button
name=
"recalcularTotal"
class=
'btn btn-warning'
string=
"Recalcular Monto"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
</xpath>
</data>
</field>
</record>
-->
<record
id=
"view_form_inherit_comprobante_afip_ui"
model=
"ir.ui.view"
>
<field
name=
"name"
>
Comprobante
</field>
<field
name=
"model"
>
asw.comprobante
</field>
...
...
wizard/prod_pfinal.py
View file @
450bb31
...
...
@@ -9,6 +9,7 @@ class asw_prod_pfinal(models.TransientModel):
string
=
u'Producto'
,
comodel_name
=
'asw.producto'
,
ondelete
=
'set null'
,
default
=
(
1
)
)
ppf_descripcion_producto
=
fields
.
Text
(
...
...
@@ -32,6 +33,14 @@ class asw_prod_pfinal(models.TransientModel):
store
=
True
)
ppf_importe
=
fields
.
Monetary
(
string
=
u'Importe de linea'
,
currency_field
=
'ppf_moneda'
,
readonly
=
True
,
store
=
True
,
compute
=
"obtener_ppf_precio_bruto"
)
ppf_precio_bruto
=
fields
.
Monetary
(
string
=
u'Precio Bruto'
,
currency_field
=
'ppf_moneda'
,
...
...
@@ -51,6 +60,7 @@ class asw_prod_pfinal(models.TransientModel):
string
=
u'IVA'
,
comodel_name
=
'asw.impuesto'
,
ondelete
=
'set null'
,
default
=
lambda
self
:
self
.
env
[
"asw.impuesto"
]
.
search
([[
"name"
,
"="
,
"21
%
"
]],
limit
=
1
)
.
id
)
#metodo para obtener el dominio de prods
...
...
@@ -65,24 +75,34 @@ class asw_prod_pfinal(models.TransientModel):
#metodo de creacion de linea de factura y su asociacion al comprobante en curso
def
crear_linea
(
self
):
pb
=
self
.
ppf_precio_bruto
pi
=
self
.
ppf_importe
vals
=
{
'lcp_producto'
:
self
.
ppf_producto
.
id
,
'lcp_descripcion_producto'
:
self
.
ppf_descripcion_producto
,
'lcp_comprobante'
:
self
.
ppf_comprobante
.
id
,
'lcp_cantidad'
:
self
.
ppf_cantidad
,
'lcp_precio'
:
pb
,
'lcp_importe'
:
self
.
ppf_precio
,
'lcp_importe'
:
pi
,
'lcp_moneda'
:
self
.
ppf_moneda
.
id
,
'lcp_iva'
:
self
.
ppf_impuesto
.
id
,
}
#print(vals)
nva_lineaf
=
self
.
env
[
'asw.linea_comprobante'
]
.
create
(
vals
)
#print(self.ppf_comprobante._onchange_comp_linea_facturas())
return
(
nva_lineaf
.
_onchange_precio_venta
())
@api.depends
(
'ppf_impuesto'
,
'ppf_precio'
)
def
obtener_ppf_precio_bruto
(
self
):
pnet
=
self
.
ppf_precio
iva
=
self
.
ppf_impuesto
.
imp_porcentaje
self
.
ppf_precio_bruto
=
((
100
-
iva
)
/
100
)
*
self
.
ppf_precio
pnet
=
self
.
ppf_precio
#precio final / Bruto
iva
=
self
.
ppf_impuesto
.
imp_porcentaje
#iva en porsentaje
self
.
ppf_precio_bruto
=
(
self
.
ppf_precio
/
((
100
+
iva
)
/
100
))
/
self
.
ppf_cantidad
#Neto unitario
self
.
ppf_importe
=
self
.
ppf_precio
/
((
100
+
iva
)
/
100
)
#Importe de linea sin iva
@api.onchange
(
'ppf_producto'
)
def
_onchange_ppf_producto
(
self
):
self
.
ppf_impuesto
=
self
.
ppf_producto
.
prod_imp_venta
self
.
ppf_descripcion_producto
=
self
.
ppf_producto
.
prod_descripcion
...
...
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