Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
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
61812370
Commit
61812370
authored
Jan 22, 2020
by
Daniel Santibáñez Polanco
Browse files
[IMP]Se agrega container y mejoras en agregar bulto
parent
ca01e9e0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
18 deletions
+43
-18
data/aduanas.tipos_bulto.csv
data/aduanas.tipos_bulto.csv
+0
-5
models/__init__.py
models/__init__.py
+1
-0
models/account_invoice.py
models/account_invoice.py
+12
-4
models/account_invoice_exportacion.py
models/account_invoice_exportacion.py
+17
-4
views/invoice_exportacion.xml
views/invoice_exportacion.xml
+6
-2
views/invoice_view.xml
views/invoice_view.xml
+7
-3
No files found.
data/aduanas.tipos_bulto.csv
View file @
61812370
...
...
@@ -55,9 +55,4 @@ code,name,sigla
"90","ATADOS","ATADO"
"91","BOBINA","BOBINA"
"92","OTROS"
""
""
""
""
"99","SIN EMBALAR","S/EMBALAR"
"
models/__init__.py
View file @
61812370
...
...
@@ -10,4 +10,5 @@ from . import aduanas_tipos_carga
from
.
import
aduanas_tipos_transporte
from
.
import
product_uom
from
.
import
payment_terms
from
.
import
res_country
from
.
import
stock_incoterms
models/account_invoice.py
View file @
61812370
...
...
@@ -221,9 +221,7 @@ class Exportacion(models.Model):
ciudad_recep
=
self
.
partner_id
.
city
or
self
.
commercial_partner_id
.
city
if
ciudad_recep
:
Receptor
[
'CiudadRecep'
]
=
ciudad_recep
country
=
self
.
env
[
'aduanas.paises'
].
sudo
().
search
([
(
'name'
,
'='
,
self
.
partner_id
.
commercial_partner_id
.
country_id
.
name
.
upper
())])
Receptor
[
'Nacionalidad'
]
=
country
.
code
Receptor
[
'Nacionalidad'
]
=
self
.
partner_id
.
commercial_partner_id
.
country_id
.
aduanas_id
.
code
return
Receptor
def
_validaciones_uso_dte
(
self
):
...
...
@@ -248,7 +246,12 @@ class Exportacion(models.Model):
Bulto
=
dict
()
Bulto
[
'CodTpoBultos'
]
=
b
.
tipo_bulto
.
code
Bulto
[
'CantBultos'
]
=
b
.
cantidad_bultos
Bulto
[
'Marcas'
]
=
b
.
marcas
if
b
.
marcas
:
Bulto
[
'Marcas'
]
=
b
.
marcas
if
b
.
id_container
:
Bulto
[
'IdContainer'
]
=
b
.
id_container
Bulto
[
'Sello'
]
=
b
.
sello
Bulto
[
'EmisorSello'
]
=
b
.
emisor_sello
Bultos
.
append
(
Bulto
)
return
Bultos
...
...
@@ -392,3 +395,8 @@ class Exportacion(models.Model):
@
api
.
onchange
(
'bultos'
)
def
tot_bultos
(
self
):
self
.
exportacion
.
tot_bultos
()
@
api
.
onchange
(
'currency_id'
)
def
update_exportacion
(
self
):
if
self
.
exportacion
:
self
.
exportacion
.
currency_id
=
self
.
currency_id
models/account_invoice_exportacion.py
View file @
61812370
...
...
@@ -101,17 +101,30 @@ class Exportacion(models.Model):
class
Bultos
(
models
.
Model
):
_name
=
'account.invoice.exportacion.bultos'
_description
=
"Bultos de la exportación"
exportacion_id
=
fields
.
Many2one
(
'account.invoice.exportacion'
,
)
tipo_bulto
=
fields
.
Many2one
(
'aduanas.tipos_bulto'
,
string
=
'Tipo de Bulto'
,
)
tipo_bulto_code
=
fields
.
Char
(
related
=
"tipo_bulto.code"
)
cantidad_bultos
=
fields
.
Integer
(
string
=
"Cantidad de Bultos"
,
)
marcas
=
fields
.
Char
(
string
=
"Identificación de marcas"
,
)
exportacion_id
=
fields
.
Many2one
(
'account.invoice.exportacion'
,
string
=
"Identificación de marcas"
,
)
id_container
=
fields
.
Char
(
string
=
"Id Container"
)
sello
=
fields
.
Char
(
string
=
"Sello"
)
emisor_sello
=
fields
.
Char
(
string
=
"Emisor Sello"
)
views/invoice_exportacion.xml
View file @
61812370
...
...
@@ -39,9 +39,13 @@
<form
string=
"Bultos"
>
<sheet>
<group>
<field
name=
"tipo_bulto"
/>
<field
name=
"cantidad_bultos"
/>
<field
name=
"marcas"
/>
<field
name=
"tipo_bulto"
/>
<field
name=
"tipo_bulto_code"
invisible=
"1"
/>
<field
name=
"marcas"
attrs=
"{'invisible': [('tipo_bulto_code', 'in', ['75', '78'])], 'required': ('tipo_bulto_code', 'not in', ['75', '78'])}"
/>
<field
name=
"id_container"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])], 'required': ('tipo_bulto_code', 'in', ['75', '78'])}"
/>
<field
name=
"sello"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])], 'required': ('tipo_bulto_code', 'in', ['75', '78'])}"
/>
<field
name=
"emisor_sello"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])]}"
/>
<field
name=
"exportacion_id"
invisible=
"1"
/>
</group>
</sheet>
...
...
views/invoice_view.xml
View file @
61812370
...
...
@@ -38,10 +38,14 @@
</group>
<h4>
Bultos
</h4>
<field
name=
"bultos"
context=
"{'default_exportacion_id': exportacion}"
>
<tree
editable=
"bottom"
>
<tree>
<field
name=
"cantidad_bultos"
/>
<field
name=
"tipo_bulto"
/>
<field
name=
"marcas"
/>
<field
name=
"tipo_bulto"
/>
<field
name=
"tipo_bulto_code"
invisible=
"1"
/>
<field
name=
"marcas"
attrs=
"{'invisible': [('tipo_bulto_code', 'in', ['75', '78'])], 'required': ('tipo_bulto_code', 'not in', ['75', '78'])}"
/>
<field
name=
"id_container"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])], 'required': ('tipo_bulto_code', 'in', ['75', '78'])}"
/>
<field
name=
"sello"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])], 'required': ('tipo_bulto_code', 'in', ['75', '78'])}"
/>
<field
name=
"emisor_sello"
attrs=
"{'invisible': [('tipo_bulto_code', 'not in', ['75', '78'])]}"
/>
<field
name=
"exportacion_id"
invisible=
"1"
/>
</tree>
</field>
...
...
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