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
Jorels Community
Edi
Commits
9b825396
Commit
9b825396
authored
Jan 08, 2021
by
Jorge Sanabria
Browse files
Update 2021-01-08 20:24
parent
1b168619
Changes
72
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
14185 additions
and
11452 deletions
+14185
-11452
l10n_co_edi_jorels/CONTRIBUTING.md
l10n_co_edi_jorels/CONTRIBUTING.md
+3
-3
l10n_co_edi_jorels/README.md
l10n_co_edi_jorels/README.md
+1
-1
l10n_co_edi_jorels/__init__.py
l10n_co_edi_jorels/__init__.py
+1
-1
l10n_co_edi_jorels/__manifest__.py
l10n_co_edi_jorels/__manifest__.py
+16
-6
l10n_co_edi_jorels/controllers/__init__.py
l10n_co_edi_jorels/controllers/__init__.py
+23
-1
l10n_co_edi_jorels/controllers/main.py
l10n_co_edi_jorels/controllers/main.py
+22
-0
l10n_co_edi_jorels/data/data.xml
l10n_co_edi_jorels/data/data.xml
+1
-1
l10n_co_edi_jorels/data/mail_template_data.xml
l10n_co_edi_jorels/data/mail_template_data.xml
+21
-2
l10n_co_edi_jorels/i18n/es_CO.po
l10n_co_edi_jorels/i18n/es_CO.po
+1050
-11298
l10n_co_edi_jorels/models/__init__.py
l10n_co_edi_jorels/models/__init__.py
+1
-1
l10n_co_edi_jorels/models/account_invoice.py
l10n_co_edi_jorels/models/account_invoice.py
+56
-18
l10n_co_edi_jorels/models/config/__init__.py
l10n_co_edi_jorels/models/config/__init__.py
+5
-4
l10n_co_edi_jorels/models/config/account_product.py
l10n_co_edi_jorels/models/config/account_product.py
+1
-1
l10n_co_edi_jorels/models/config/account_taxes.py
l10n_co_edi_jorels/models/config/account_taxes.py
+1
-1
l10n_co_edi_jorels/models/config/ir_sequence.py
l10n_co_edi_jorels/models/config/ir_sequence.py
+1
-1
l10n_co_edi_jorels/models/config/res_company.py
l10n_co_edi_jorels/models/config/res_company.py
+6
-6
l10n_co_edi_jorels/models/config/res_config_settings.py
l10n_co_edi_jorels/models/config/res_config_settings.py
+18
-14
l10n_co_edi_jorels/models/config/resolution.py
l10n_co_edi_jorels/models/config/resolution.py
+12
-10
l10n_co_edi_jorels/models/config/uom_uom.py
l10n_co_edi_jorels/models/config/uom_uom.py
+30
-0
l10n_co_edi_jorels/models/listings/__init__.py
l10n_co_edi_jorels/models/listings/__init__.py
+1
-1
l10n_co_edi_jorels/models/listings/correction_concepts.py
l10n_co_edi_jorels/models/listings/correction_concepts.py
+1
-1
l10n_co_edi_jorels/models/listings/countries.py
l10n_co_edi_jorels/models/listings/countries.py
+1
-1
l10n_co_edi_jorels/models/listings/departments.py
l10n_co_edi_jorels/models/listings/departments.py
+1
-1
l10n_co_edi_jorels/models/listings/discounts.py
l10n_co_edi_jorels/models/listings/discounts.py
+1
-1
l10n_co_edi_jorels/models/listings/languages.py
l10n_co_edi_jorels/models/listings/languages.py
+1
-1
l10n_co_edi_jorels/models/listings/municipalities.py
l10n_co_edi_jorels/models/listings/municipalities.py
+1
-1
l10n_co_edi_jorels/models/listings/payment_forms.py
l10n_co_edi_jorels/models/listings/payment_forms.py
+1
-1
l10n_co_edi_jorels/models/listings/payment_methods.py
l10n_co_edi_jorels/models/listings/payment_methods.py
+1
-1
l10n_co_edi_jorels/models/listings/reference_prices.py
l10n_co_edi_jorels/models/listings/reference_prices.py
+1
-1
l10n_co_edi_jorels/models/listings/tax_details.py
l10n_co_edi_jorels/models/listings/tax_details.py
+1
-1
l10n_co_edi_jorels/models/listings/taxes.py
l10n_co_edi_jorels/models/listings/taxes.py
+1
-1
l10n_co_edi_jorels/models/listings/type_currencies.py
l10n_co_edi_jorels/models/listings/type_currencies.py
+1
-1
l10n_co_edi_jorels/models/listings/type_document_identifications.py
...i_jorels/models/listings/type_document_identifications.py
+1
-1
l10n_co_edi_jorels/models/listings/type_documents.py
l10n_co_edi_jorels/models/listings/type_documents.py
+1
-1
l10n_co_edi_jorels/models/listings/type_environments.py
l10n_co_edi_jorels/models/listings/type_environments.py
+1
-1
l10n_co_edi_jorels/models/listings/type_item_identifications.py
...o_edi_jorels/models/listings/type_item_identifications.py
+1
-1
l10n_co_edi_jorels/models/listings/type_liabilities.py
l10n_co_edi_jorels/models/listings/type_liabilities.py
+1
-1
l10n_co_edi_jorels/models/listings/type_operations.py
l10n_co_edi_jorels/models/listings/type_operations.py
+1
-1
l10n_co_edi_jorels/models/listings/type_organizations.py
l10n_co_edi_jorels/models/listings/type_organizations.py
+1
-1
l10n_co_edi_jorels/models/listings/type_regimes.py
l10n_co_edi_jorels/models/listings/type_regimes.py
+1
-1
l10n_co_edi_jorels/models/listings/unit_measures.py
l10n_co_edi_jorels/models/listings/unit_measures.py
+1
-1
l10n_co_edi_jorels/models/mail_template.py
l10n_co_edi_jorels/models/mail_template.py
+22
-0
l10n_co_edi_jorels/models/res_partner.py
l10n_co_edi_jorels/models/res_partner.py
+1
-1
l10n_co_edi_jorels/report/report_invoice.xml
l10n_co_edi_jorels/report/report_invoice.xml
+52
-30
l10n_co_edi_jorels/security/security.xml
l10n_co_edi_jorels/security/security.xml
+1
-1
l10n_co_edi_jorels/static/account/i18n/es_CO.po
l10n_co_edi_jorels/static/account/i18n/es_CO.po
+11402
-0
l10n_co_edi_jorels/static/description/index.html
l10n_co_edi_jorels/static/description/index.html
+1
-1
l10n_co_edi_jorels/static/uom/uom.png
l10n_co_edi_jorels/static/uom/uom.png
+0
-0
l10n_co_edi_jorels/views/account_invoice_view.xml
l10n_co_edi_jorels/views/account_invoice_view.xml
+1
-1
l10n_co_edi_jorels/views/config/account_taxes_view.xml
l10n_co_edi_jorels/views/config/account_taxes_view.xml
+1
-1
l10n_co_edi_jorels/views/config/ir_sequence.xml
l10n_co_edi_jorels/views/config/ir_sequence.xml
+1
-1
l10n_co_edi_jorels/views/config/res_company.xml
l10n_co_edi_jorels/views/config/res_company.xml
+1
-1
l10n_co_edi_jorels/views/config/res_config_settings_views.xml
..._co_edi_jorels/views/config/res_config_settings_views.xml
+22
-9
l10n_co_edi_jorels/views/config/resolution_views.xml
l10n_co_edi_jorels/views/config/resolution_views.xml
+1
-1
l10n_co_edi_jorels/views/config/uom_uom_views.xml
l10n_co_edi_jorels/views/config/uom_uom_views.xml
+45
-0
l10n_co_edi_jorels/views/res_partner_view.xml
l10n_co_edi_jorels/views/res_partner_view.xml
+1
-1
l10n_co_edi_jorels_pos/LICENSE
l10n_co_edi_jorels_pos/LICENSE
+165
-0
l10n_co_edi_jorels_pos/README.md
l10n_co_edi_jorels_pos/README.md
+23
-0
l10n_co_edi_jorels_pos/__init__.py
l10n_co_edi_jorels_pos/__init__.py
+23
-0
l10n_co_edi_jorels_pos/__manifest__.py
l10n_co_edi_jorels_pos/__manifest__.py
+45
-0
l10n_co_edi_jorels_pos/i18n/es_CO.mo
l10n_co_edi_jorels_pos/i18n/es_CO.mo
+0
-0
l10n_co_edi_jorels_pos/i18n/es_CO.po
l10n_co_edi_jorels_pos/i18n/es_CO.po
+263
-0
l10n_co_edi_jorels_pos/models/__init__.py
l10n_co_edi_jorels_pos/models/__init__.py
+24
-0
l10n_co_edi_jorels_pos/models/pos_config.py
l10n_co_edi_jorels_pos/models/pos_config.py
+37
-0
l10n_co_edi_jorels_pos/models/pos_order.py
l10n_co_edi_jorels_pos/models/pos_order.py
+124
-0
l10n_co_edi_jorels_pos/static/description/icon.png
l10n_co_edi_jorels_pos/static/description/icon.png
+0
-0
l10n_co_edi_jorels_pos/static/description/index.html
l10n_co_edi_jorels_pos/static/description/index.html
+30
-0
l10n_co_edi_jorels_pos/static/src/css/pos.css
l10n_co_edi_jorels_pos/static/src/css/pos.css
+3
-0
l10n_co_edi_jorels_pos/static/src/js/pos.js
l10n_co_edi_jorels_pos/static/src/js/pos.js
+342
-0
l10n_co_edi_jorels_pos/static/src/xml/pos.xml
l10n_co_edi_jorels_pos/static/src/xml/pos.xml
+214
-0
l10n_co_edi_jorels_pos/views/pos_config_view.xml
l10n_co_edi_jorels_pos/views/pos_config_view.xml
+40
-0
l10n_co_edi_jorels_pos/views/pos_view.xml
l10n_co_edi_jorels_pos/views/pos_view.xml
+9
-13
No files found.
l10n_co_edi_jorels/CONTRIBUTING.md
View file @
9b825396
l10n_co_edi_jorels
------------------
Copyright (2019-202
0
) - Jorels SAS
Copyright (2019-202
1
) - Jorels SAS
[
info@jorels.com
](
mailto:info@jorels.com
)
...
...
@@ -12,6 +12,6 @@ Under LGPL (Lesser General Public License)
Contributing
============
Jorge Sanabria -
[
js@jorels.com
](
mailto:js@jorels.com
)
Jorge Sanabria
(2021)
-
[
js@jorels.com
](
mailto:js@jorels.com
)
Leonardo Martinez -
[
lotharius96@protonmail.ch
](
mailto:lotharius96@protonmail.ch
)
Leonardo Martinez
(2020)
-
[
lotharius96@protonmail.ch
](
mailto:lotharius96@protonmail.ch
)
l10n_co_edi_jorels/README.md
View file @
9b825396
l10n_co_edi_jorels
------------------
Copyright (2019-202
0
) - Jorels SAS
Copyright (2019-202
1
) - Jorels SAS
[
info@jorels.com
](
mailto:info@jorels.com
)
...
...
l10n_co_edi_jorels/__init__.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/__manifest__.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -49,17 +49,27 @@
'views/config/res_config_settings_views.xml'
,
'views/config/resolution_views.xml'
,
'views/config/ir_sequence.xml'
,
'views/config/
account_product
_view.xml'
,
'views/config/
uom_uom
_view
s
.xml'
,
'views/config/account_taxes_view.xml'
,
'views/account_invoice_view.xml'
,
'views/res_partner_view.xml'
,
'report/report_invoice.xml'
,
'data/mail_template_data.xml'
,
],
# 'external_dependencies': {
# 'python': [
# ]
# },
'external_dependencies'
:
{
'python'
:
[
'num2words'
,
'json'
,
'base64'
,
'math'
,
'tempfile'
,
'zipfile'
,
'pathlib'
,
'qrcode'
,
'requests'
,
'io'
]
},
'installable'
:
True
,
'application'
:
False
,
}
l10n_co_edi_jorels/controllers/__init__.py
View file @
9b825396
from
.
import
main
\ No newline at end of file
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-2021)
#
# This file is part of l10n_co_edi_jorels.
#
# l10n_co_edi_jorels is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# l10n_co_edi_jorels is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with l10n_co_edi_jorels. If not, see <https://www.gnu.org/licenses/>.
#
# email: info@jorels.com
#
from
.
import
main
l10n_co_edi_jorels/controllers/main.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-2021)
#
# This file is part of l10n_co_edi_jorels.
#
# l10n_co_edi_jorels is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# l10n_co_edi_jorels is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with l10n_co_edi_jorels. If not, see <https://www.gnu.org/licenses/>.
#
# email: info@jorels.com
#
import
json
import
logging
...
...
l10n_co_edi_jorels/data/data.xml
View file @
9b825396
<?xml version="1.0" encoding="utf-8"?>
<!--Jorels S.A.S. - Copyright (2019-202
0
)-->
<!--Jorels S.A.S. - Copyright (2019-202
1
)-->
<!--This file is part of l10n_co_edi_jorels.-->
...
...
l10n_co_edi_jorels/data/mail_template_data.xml
View file @
9b825396
<?xml version="1.0" ?>
<?xml version="1.0" encoding="utf-8"?>
<!--Jorels S.A.S. - Copyright (2019-2021)-->
<!--This file is part of l10n_co_edi_jorels.-->
<!--l10n_co_edi_jorels is free software: you can redistribute it and/or modify-->
<!--it under the terms of the GNU Lesser General Public License as published by-->
<!--the Free Software Foundation, either version 3 of the License, or-->
<!--(at your option) any later version.-->
<!--l10n_co_edi_jorels is distributed in the hope that it will be useful,-->
<!--but WITHOUT ANY WARRANTY; without even the implied warranty of-->
<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-->
<!--GNU Lesser General Public License for more details.-->
<!--You should have received a copy of the GNU Lesser General Public License-->
<!--along with l10n_co_edi_jorels. If not, see <https://www.gnu.org/licenses/>.-->
<!--email: info@jorels.com-->
<odoo>
<data
noupdate=
"1"
>
<record
id=
"account.email_template_edi_invoice"
model=
"mail.template"
>
<field
name=
"name"
>
Invoice: Send by email
</field>
<field
name=
"model_id"
ref=
"account.model_account_invoice"
/>
<!-- <field name="email_from">${object.user_id.email_formatted |safe}</field>-->
<field
name=
"email_from"
>
${object.company_id.email_edi}
</field>
<field
name=
"email_to"
>
${object.partner_id.email_edi}
</field>
<field
name=
"partner_to"
>
${object.partner_id.id}
</field>
...
...
l10n_co_edi_jorels/i18n/es_CO.po
View file @
9b825396
This diff is collapsed.
Click to expand it.
l10n_co_edi_jorels/models/__init__.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/account_invoice.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -20,25 +20,27 @@
# email: info@jorels.com
#
import
base64
from
odoo
import
api
,
fields
,
models
,
tools
import
logging
from
odoo
import
api
,
fields
,
models
from
odoo.exceptions
import
Warning
import
json
import
requests
import
qrcode
from
io
import
BytesIO
import
zipfile
,
tempfile
from
pathlib
import
Path
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
try
:
import
base64
import
json
import
math
import
tempfile
import
zipfile
import
qrcode
import
requests
from
io
import
BytesIO
from
pathlib
import
Path
from
num2words
import
num2words
except
Exception
as
err
:
_logger
.
debug
(
err
)
class
AccountInvoice
(
models
.
Model
):
_inherit
=
"account.invoice"
...
...
@@ -91,6 +93,8 @@ class AccountInvoice(models.Model):
# Total base excluida de impuestos
ei_amount_excluded
=
fields
.
Monetary
(
"Excluido"
,
compute
=
"_compute_amount"
,
store
=
True
)
value_letters
=
fields
.
Char
(
"Valor en letras"
,
compute
=
"_compute_amount"
,
store
=
True
)
def
action_invoice_sent
(
self
):
self
.
ensure_one
()
action
=
super
().
action_invoice_sent
()
...
...
@@ -306,8 +310,12 @@ class AccountInvoice(models.Model):
products
.
update
({
'description'
:
invoice_line_id
.
name
})
if
invoice_line_id
.
product_id
.
edi_unit_measure_id
.
id
:
products
.
update
({
'unit_measure_id'
:
invoice_line_id
.
product_id
.
edi_unit_measure_id
.
id
}),
if
invoice_line_id
.
product_id
.
uom_id
.
edi_unit_measure_id
.
id
:
products
.
update
({
'unit_measure_id'
:
invoice_line_id
.
product_id
.
uom_id
.
edi_unit_measure_id
.
id
})
elif
invoice_line_id
.
product_id
.
edi_unit_measure_id
.
id
:
# Si se usa la configuracion en la unidad de medida de Odoo, entonces este campo no es necesario
# Sin embargo se deja por compatibilidad con campos ya existentes
products
.
update
({
'unit_measure_id'
:
invoice_line_id
.
product_id
.
edi_unit_measure_id
.
id
})
else
:
raise
Warning
(
"Todos los productos deben tener asignada una 'Unidad de medida (DIAN)'.
\n
"
"Revise, por favor."
)
...
...
@@ -439,6 +447,19 @@ class AccountInvoice(models.Model):
self
.
ei_amount_tax_no_withholding
=
amount_tax_no_withholding
self
.
ei_amount_total_no_withholding
=
self
.
amount_untaxed
+
amount_tax_no_withholding
self
.
ei_amount_excluded
=
amount_excluded
# Valor en letras
decimal_part
,
integer_part
=
math
.
modf
(
self
.
amount_total
)
if
decimal_part
:
decimal_part
=
round
(
decimal_part
*
math
.
pow
(
10
,
self
.
currency_id
.
decimal_places
))
if
integer_part
:
self
.
value_letters
=
num2words
(
integer_part
,
lang
=
self
.
partner_id
.
lang
).
upper
()
+
' '
+
\
self
.
currency_id
.
currency_unit_label
.
upper
()
if
decimal_part
:
self
.
value_letters
=
self
.
value_letters
+
', '
+
\
num2words
(
decimal_part
,
lang
=
self
.
partner_id
.
lang
).
upper
()
+
' '
+
\
self
.
currency_id
.
currency_subunit_label
.
upper
()
+
'.'
return
res
@
api
.
multi
...
...
@@ -791,6 +812,18 @@ class AccountInvoice(models.Model):
def
skip_validate_dian_production
(
self
):
self
.
skip_validate_dian
()
@
api
.
multi
def
is_journal_pos
(
self
):
self
.
ensure_one
()
try
:
journal_pos_rec
=
self
.
env
[
'pos.config'
].
search
([(
'invoice_journal_id.id'
,
'='
,
self
.
journal_id
.
id
)])
if
journal_pos_rec
:
return
True
else
:
return
False
except
KeyError
:
return
False
@
api
.
multi
def
action_invoice_open
(
self
):
previous_invoice_state_is_draft
=
False
...
...
@@ -801,7 +834,10 @@ class AccountInvoice(models.Model):
if
previous_invoice_state_is_draft
:
to_open_invoices
=
self
.
filtered
(
lambda
inv
:
inv
.
state
==
'open'
)
if
to_open_invoices
.
filtered
(
lambda
inv
:
inv
.
type
in
(
'out_invoice'
,
'out_refund'
)):
if
to_open_invoices
.
filtered
(
lambda
inv
:
inv
.
type
in
(
'out_invoice'
,
'out_refund'
)
and
not
inv
.
ei_is_valid
and
not
inv
.
is_journal_pos
()):
# Entorno
to_open_invoices
.
filtered
(
lambda
inv
:
inv
.
write
({
'ei_is_not_test'
:
inv
.
env
.
user
.
company_id
.
is_not_test
}))
...
...
@@ -813,6 +849,8 @@ class AccountInvoice(models.Model):
if
to_open_invoices
.
filtered
(
lambda
inv
:
inv
.
ei_is_not_test
):
to_open_invoices
.
validate_dian_generic
(
False
)
if
to_open_invoices
.
filtered
(
lambda
inv
:
inv
.
env
.
user
.
company_id
.
enable_mass_send_print
):
to_open_invoices
.
mass_send_print
()
if
to_open_invoices
.
filtered
(
lambda
inv
:
not
inv
.
ei_is_not_test
):
to_open_invoices
.
validate_dian_generic
(
True
)
...
...
l10n_co_edi_jorels/models/config/__init__.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -20,9 +20,10 @@
# email: info@jorels.com
#
from
.
import
account_product
from
.
import
account_taxes
from
.
import
ir_sequence
from
.
import
uom_uom
from
.
import
res_company
from
.
import
res_config_settings
from
.
import
resolution
from
.
import
account_taxes
from
.
import
account_product
from
.
import
ir_sequence
l10n_co_edi_jorels/models/config/account_product.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/config/account_taxes.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/config/ir_sequence.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/config/res_company.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -20,14 +20,12 @@
# email: info@jorels.com
#
import
json
import
logging
from
odoo
import
api
,
fields
,
models
,
tools
from
odoo.exceptions
import
Warning
from
pathlib
import
Path
import
json
import
requests
from
pathlib
import
Path
from
odoo
import
api
,
fields
,
models
_logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -75,6 +73,8 @@ class ResCompany(models.Model):
test_set_id
=
fields
.
Char
(
string
=
"TestSetId"
)
enable_validate_state
=
fields
.
Boolean
(
string
=
"Habilitar estado intermedio de Validación DIAN en la facturación"
,
default
=
True
)
enable_mass_send_print
=
fields
.
Boolean
(
string
=
"Email automatico de la factura al validar(En producción)"
,
default
=
False
)
# Report
report_custom_text
=
fields
.
Html
(
string
=
"Custom text"
)
...
...
l10n_co_edi_jorels/models/config/res_config_settings.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -20,14 +20,13 @@
# email: info@jorels.com
#
from
odoo
import
api
,
fields
,
models
,
_
from
odoo.exceptions
import
Warning
import
json
import
requests
import
logging
from
pathlib
import
Path
import
logging
import
requests
from
odoo
import
api
,
fields
,
models
from
odoo.exceptions
import
Warning
_logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -59,6 +58,9 @@ class ResConfigSettings(models.TransientModel):
enable_validate_state
=
fields
.
Boolean
(
related
=
"company_id.enable_validate_state"
,
string
=
"Estado internedio Validación DIAN"
,
default
=
True
,
readonly
=
False
)
enable_mass_send_print
=
fields
.
Boolean
(
related
=
"company_id.enable_mass_send_print"
,
string
=
"Email automatico de la factura al validar(En producción)"
,
default
=
False
,
readonly
=
False
)
# Report
report_custom_text
=
fields
.
Html
(
related
=
"company_id.report_custom_text"
,
string
=
"Custom text"
,
readonly
=
False
)
...
...
@@ -170,19 +172,21 @@ class ResConfigSettings(models.TransientModel):
_logger
.
debug
(
'API Response: %s'
,
response
)
# No es posible comprobar la firma digital, ni el password
if
'id'
in
response
:
if
'name'
in
response
:
rec
.
certificate_message
=
"El nombre del certificado actualmente almacenado en la API es: "
+
\
response
[
'name'
]
else
:
rec
.
certificate_message
=
"No se ha encontrado un certificado. "
\
"¡Suba uno o Intente nuevamente!"
elif
'message'
in
response
:
if
'message'
in
response
:
if
response
[
'message'
]
==
'Unauthenticated.'
or
response
[
'message'
]
==
''
:
rec
.
certificate_message
=
'No es posible la autenticación con la API. '
\
'Revise su Api key e intente nuevamente.'
else
:
rec
.
certificate_message
=
response
[
'message'
]
elif
'is_valid'
in
response
:
if
response
[
'is_valid'
]:
if
'organization'
in
response
:
rec
.
certificate_message
=
"Certificado valido para la empresa: "
+
response
[
'organization'
]
else
:
rec
.
certificate_message
=
"Certificado valido en servidor"
else
:
rec
.
certificate_message
=
"No se ha encontrado un certificado. "
\
"¡Suba uno o Intente nuevamente!"
else
:
rec
.
certificate_message
=
'Algo sucede. No es posible comunicarse con la API'
...
...
l10n_co_edi_jorels/models/config/resolution.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
@@ -20,18 +20,20 @@
# email: info@jorels.com
#
from
odoo
import
api
,
fields
,
models
,
_
from
odoo.exceptions
import
Warning
import
json
import
requests
from
pathlib
import
Path
import
logging
from
odoo
import
api
,
fields
,
models
from
odoo.exceptions
import
Warning
_logger
=
logging
.
getLogger
(
__name__
)
try
:
import
json
import
requests
from
pathlib
import
Path
except
Exception
as
err
:
_logger
.
debug
(
err
)
class
Resolution
(
models
.
Model
):
_name
=
'l10n_co_edi_jorels.resolution'
...
...
@@ -62,7 +64,7 @@ class Resolution(models.Model):
def
_compute_name
(
self
):
for
rec
in
self
:
rec
.
name
=
str
(
rec
.
resolution_id
)
+
' - '
+
\
rec
.
resolution_type_document_id
.
name
+
' ['
+
rec
.
resolution_type_document_id
.
code
+
']'
rec
.
resolution_type_document_id
.
name
+
' ['
+
rec
.
resolution_type_document_id
.
code
+
']'
@
api
.
model
def
create
(
self
,
vals
):
...
...
l10n_co_edi_jorels/models/config/uom_uom.py
0 → 100644
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-2021)
#
# This file is part of l10n_co_edi_jorels.
#
# l10n_co_edi_jorels is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# l10n_co_edi_jorels is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with l10n_co_edi_jorels. If not, see <https://www.gnu.org/licenses/>.
#
# email: info@jorels.com
#
from
odoo
import
api
,
fields
,
models
,
tools
class
ProductUom
(
models
.
Model
):
_inherit
=
"uom.uom"
edi_unit_measure_id
=
fields
.
Many2one
(
comodel_name
=
'l10n_co_edi_jorels.unit_measures'
,
string
=
"Unidad de medida (DIAN)"
)
l10n_co_edi_jorels/models/listings/__init__.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/listings/correction_concepts.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/listings/countries.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/listings/departments.py
View file @
9b825396
# -*- coding: utf-8 -*-
#
# Jorels S.A.S. - Copyright (2019-202
0
)
# Jorels S.A.S. - Copyright (2019-202
1
)
#
# This file is part of l10n_co_edi_jorels.
#
...
...
l10n_co_edi_jorels/models/listings/discounts.py
View file @
9b825396
# -*- coding: utf-8 -*-
#