Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Daniel Santibáñez Polanco
l10n_cl_dte_exportacion
Commits
0a460ee8
Commit
0a460ee8
authored
Jan 01, 2020
by
Daniel Santibáñez Polanco
Browse files
Cambios relacionados a la moneda
parent
e313743f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
models/account_invoice.py
models/account_invoice.py
+13
-11
models/account_invoice_exportacion.py
models/account_invoice_exportacion.py
+0
-2
No files found.
models/account_invoice.py
View file @
0a460ee8
...
...
@@ -107,6 +107,12 @@ class Exportacion(models.Model):
return
True
return
False
def
currency_base
(
self
):
result
=
super
(
Exportacion
,
self
).
currency_base
()
if
not
self
.
_es_exportacion
():
return
result
return
self
.
currency_id
def
_totales_normal
(
self
,
currency_id
,
MntExe
,
MntNeto
,
IVA
,
TasaIVA
,
MntTotal
=
0
,
MntBase
=
0
):
if
not
self
.
_es_exportacion
():
...
...
@@ -141,17 +147,6 @@ class Exportacion(models.Model):
Totales
[
'MntTotOtrMnda'
]
=
MntTotal
return
Totales
def
_aplicar_gdr
(
self
,
MntExe
):
gdr
=
self
.
porcentaje_dr
()
MntExe
*=
gdr
return
self
.
currency_id
.
round
(
MntExe
)
def
_totales
(
self
,
MntExe
=
0
,
no_product
=
False
,
taxInclude
=
False
):
MntExe
,
MntNeto
,
MntIVA
,
TasaIVA
,
MntTotal
,
MntBase
=
super
(
Exportacion
,
self
).
_totales
(
MntExe
,
no_product
,
taxInclude
)
if
self
.
_es_exportacion
():
MntExe
=
self
.
_aplicar_gdr
(
MntExe
)
return
MntExe
,
MntNeto
,
MntIVA
,
TasaIVA
,
MntTotal
,
MntBase
def
_bultos
(
self
,
bultos
):
Bultos
=
[]
for
b
in
bultos
:
...
...
@@ -251,5 +246,12 @@ class Exportacion(models.Model):
res
=
super
(
Exportacion
,
self
).
_encabezado
(
MntExe
,
no_product
,
taxInclude
)
if
not
self
.
_es_exportacion
():
return
res
if
not
res
.
get
(
'OtraMoneda'
):
another_currency_id
=
self
.
env
.
ref
(
'base.CLP'
).
with_context
(
date
=
self
.
date_invoice
)
MntExe
,
MntNeto
,
IVA
,
TasaIVA
,
MntTotal
,
MntBase
=
self
.
_totales
(
MntExe
,
no_product
,
taxInclude
)
res
[
'OtraMoneda'
]
=
self
.
_totales_otra_moneda
(
another_currency_id
,
MntExe
,
MntNeto
,
IVA
,
TasaIVA
,
MntTotal
,
MntBase
)
res
[
'Transporte'
]
=
self
.
_transporte
()
return
res
models/account_invoice_exportacion.py
View file @
0a460ee8
# -*- coding: utf-8 -*-
from
odoo
import
fields
,
models
,
api
,
_
class
Exportacion
(
models
.
Model
):
_name
=
"account.invoice.exportacion"
...
...
@@ -15,7 +14,6 @@ class Exportacion(models.Model):
r
.
total_bultos
=
tot_bultos
@
api
.
depends
(
'invoice_id.global_descuentos_recargos'
)
@
api
.
onchange
(
'invoice_id.global_descuentos_recargos'
)
def
_get_tot_from_recargos
(
self
):
for
r
in
self
:
mnt_seguro
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment