Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
5c0c949
[REF] account_edi: allowing moves of entry type to be sent when neces…
jco-odoo May 11, 2022
2011b19
[IMP] l10n_ec: update and upgrade
odoostan Jul 14, 2022
f0a5206
[IMP] Small fixes and improvements
pepetreshere Jul 16, 2022
06c3171
[FIX] More fixes!
pepetreshere Jul 17, 2022
6e6d1b3
[FIX] Remove active field
pepetreshere Jul 17, 2022
2d36a91
[ADD] Support for sending withholds by email
pepetreshere Jul 17, 2022
0b302ee
[FIX] Style
pepetreshere Jul 17, 2022
e6d68ee
[IMP] Simplified journal form form emission fields
pepetreshere Aug 3, 2022
db821c2
[IMP] Simplified ecuadorian transaction identification type
pepetreshere Aug 3, 2022
09815a5
[IMP] Improved the validation of third party documents
pepetreshere Aug 3, 2022
ca235e0
[FIX] Missing on change parameter
pepetreshere Aug 6, 2022
80ddacb
[TODO] === Revert === purchase liquidations hotfix
odoostan Aug 10, 2022
0600985
[IMP] Improvement to uniqueness validation
pepetreshere Sep 14, 2022
1ee598f
[IMP] Improvement to support any document (like purchase liquidation)
pepetreshere Sep 14, 2022
c8d06c3
[IMP] Theorical suggestion to CL based on improvements on latam
pepetreshere Sep 14, 2022
f4abb5a
[BAD FIX] TODOO+ _get_l10n_ec_identification_type
odoostan Sep 21, 2022
a03f5b5
[TOREVIEW] Execute order 18
odoostan Sep 30, 2022
b70cc13
[IMP] Improve suggested withhold algorith
pepetreshere Oct 2, 2022
2a8f8f6
Merge branch '2022-05-AC-IMP-l10n_ec_standard' of https://ghp_QX4Eolq…
pepetreshere Oct 2, 2022
d1775bf
[ADD] Purchase VAT taxes by tax supports
JuanDanielAlvarez Oct 2, 2022
6cd6571
Merge branch '15.0' into 2022-05-AC-IMP-l10n_ec_standard
pepetreshere Oct 3, 2022
b01e694
[ADD] Adds deprecation of unused tax groups
pepetreshere Oct 3, 2022
4ab0cad
[DEL] Remove unnecesary change
pepetreshere Oct 3, 2022
d792614
[IMP] Removed unnecesary code
pepetreshere Oct 3, 2022
bad1c14
[IMP] Improve method name to _can_be_emailed()
pepetreshere Oct 3, 2022
a6a2ea0
[FIX] Cleaned up _get_l10n_ec_identification_type()
pepetreshere Oct 3, 2022
1451868
[FIX] Fix formatting suggestions from runbot
pepetreshere Oct 3, 2022
c964e9c
[IMP] Document types filter and replaces 18 by 01
pepetreshere Oct 3, 2022
6289252
[FIX] Formatting suggested by runbot
pepetreshere Oct 3, 2022
13657f7
[FIX] 18 is no more
odoostan Oct 4, 2022
7a80bcb
[IMP] Now comments in data files are in lowercase
JuanDanielAlvarez Oct 12, 2022
4acd97d
[IMP] Even better comments
JuanDanielAlvarez Oct 12, 2022
9c28d1a
[IMP] Uppercase VAT
JuanDanielAlvarez Oct 12, 2022
725d457
Merge pull request #584 from TRESCLOUD/2022-05-JA-IMP-l10n_ec_standard
stevTresCloud Oct 13, 2022
3ae3990
[ADD] Bring back to life migration for vat withhold base
pepetreshere Oct 21, 2022
5586cb6
[FIX] Avoid final consumer to be mixed with foreing suppliers
pepetreshere Oct 21, 2022
91a5edc
[FIX] Remove spaces
pepetreshere Oct 21, 2022
716c568
[ADD] Reincorporate old types to avoid crash if module is not updated
pepetreshere Oct 21, 2022
24df0ea
[REF] Replace migration script with data for deprecated tax groups
pepetreshere Oct 21, 2022
487dd06
[FIX] Changed order of method
pepetreshere Oct 21, 2022
c2e01cb
[ADD] Tax mapping lines for sales of goods only
pepetreshere Oct 21, 2022
5843718
[ADD] Split Sales VAT into goods and services
pepetreshere Oct 27, 2022
2840da6
[FIX] Taxes with wrong configuration, fixes to xml data
JuanDanielAlvarez Oct 27, 2022
22b261e
Merge pull request #587 from TRESCLOUD/2022-05-JA-FIX-TAX-541
pepetreshere Oct 27, 2022
d21636e
[DEL] Undo improvements in latam document type
pepetreshere Oct 27, 2022
3acbdff
Merge branch '2022-05-AC-IMP-l10n_ec_standard' of https://ghp_QX4Eolq…
pepetreshere Oct 27, 2022
26164e8
[DEL] Remove comments on l10n_cl
pepetreshere Oct 27, 2022
e09c4b2
[IMP] Cosmetic fixes to the code
JuanDanielAlvarez Oct 27, 2022
636cfff
[FIX] Fix _is_manual_document_number instead of is_purchase_document
pepetreshere Oct 27, 2022
ac431f9
Merge branch '2022-05-AC-IMP-l10n_ec_standard' into 2022-05-JA-FIX-TA…
pepetreshere Oct 27, 2022
52e8f25
Merge pull request #588 from TRESCLOUD/2022-05-JA-FIX-TAX-541
pepetreshere Oct 27, 2022
4115d65
[IMP] Import journal emission address
JuanDanielAlvarez Oct 27, 2022
8c70f4f
Merge pull request #589 from TRESCLOUD/2022-05-JA-IMP-JOURNAL-IMPORT
pepetreshere Oct 27, 2022
94811b2
[IMP] Migration script should use only SQL
pepetreshere Oct 27, 2022
3057e37
Merge branch '2022-05-AC-IMP-l10n_ec_standard' of https://ghp_QX4Eolq…
pepetreshere Oct 27, 2022
bacbeca
[FIX] Typos in data files
pepetreshere Oct 28, 2022
dfee677
[WIP] Improve document types domain
pepetreshere Oct 28, 2022
041a08a
[FIX] Remove unneded space
pepetreshere Oct 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,10 @@ def button_draft(self):
def button_cancel(self):
self.write({'auto_post': False, 'state': 'cancel'})

def _can_be_emailed(self):
self.ensure_one()
return self.is_invoice(include_receipts=True)

def _get_mail_template(self):
"""
:return: the correct mail template based on the current move type
Expand Down Expand Up @@ -3313,7 +3317,7 @@ def action_invoice_print(self):
""" Print the invoice and mark it as sent, so that we can see more
easily the next step of the workflow
"""
if any(not move.is_invoice(include_receipts=True) for move in self):
if any(not move._can_be_emailed() for move in self):
raise UserError(_("Only invoices could be printed."))

self.filtered(lambda inv: not inv.is_move_sent).write({'is_move_sent': True})
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/ir_actions_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _render_qweb_pdf(self, res_ids=None, data=None):
invoice_reports = (self.env.ref('account.account_invoices_without_payment'), self.env.ref('account.account_invoices'))
if self in invoice_reports:
moves = self.env['account.move'].browse(res_ids)
if any(not move.is_invoice(include_receipts=True) for move in moves):
if any(not move._can_be_emailed() for move in moves):
raise UserError(_("Only invoices could be printed."))

return super()._render_qweb_pdf(res_ids=res_ids, data=data)
Expand Down
4 changes: 2 additions & 2 deletions addons/account/wizard/account_invoice_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def default_get(self, fields):
res = super(AccountInvoiceSend, self).default_get(fields)
res_ids = self._context.get('active_ids')

invoices = self.env['account.move'].browse(res_ids).filtered(lambda move: move.is_invoice(include_receipts=True))
if not invoices:
moves = self.env['account.move'].browse(res_ids).filtered(lambda move: move._can_be_emailed())
if not moves:
raise UserError(_("You can only send invoices."))

composer = self.env['mail.compose.message'].create({
Expand Down
6 changes: 3 additions & 3 deletions addons/account_edi/models/account_edi_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _compute_edi_content(self):
config_errors = doc.edi_format_id._check_move_configuration(move)
if config_errors:
res = base64.b64encode('\n'.join(config_errors).encode('UTF-8'))
elif move.is_invoice(include_receipts=True) and doc.edi_format_id._is_required_for_invoice(move):
elif move._is_edi_invoice() and doc.edi_format_id._is_required_for_invoice(move):
res = base64.b64encode(doc.edi_format_id._get_invoice_edi_content(doc.move_id))
elif move.payment_id and doc.edi_format_id._is_required_for_payment(move):
res = base64.b64encode(doc.edi_format_id._get_payment_edi_content(doc.move_id))
Expand Down Expand Up @@ -82,7 +82,7 @@ def _prepare_jobs(self):
for edi_doc in documents:
move = edi_doc.move_id
edi_format = edi_doc.edi_format_id
if move.is_invoice(include_receipts=True):
if move._is_edi_invoice():
doc_type = 'invoice'
elif move.payment_id or move.statement_line_id:
doc_type = 'payment'
Expand Down Expand Up @@ -159,7 +159,7 @@ def _postprocess_cancel_edi_results(documents, edi_result):
'blocking_level': False,
})

if move.is_invoice(include_receipts=True) and move.state == 'posted':
if move._is_edi_invoice() and move.state == 'posted':
# The user requested a cancellation of the EDI and it has been approved. Then, the invoice
# can be safely cancelled.
invoice_ids_to_cancel.add(move.id)
Expand Down
25 changes: 19 additions & 6 deletions addons/account_edi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _compute_show_reset_to_draft_button(self):
for doc in move.edi_document_ids:
if doc.edi_format_id._needs_web_services() \
and doc.state in ('sent', 'to_cancel') \
and move.is_invoice(include_receipts=True) \
and move._is_edi_invoice() \
and doc.edi_format_id._is_required_for_invoice(move):
move.show_reset_to_draft_button = False
break
Expand All @@ -116,7 +116,7 @@ def _compute_edi_show_cancel_button(self):

move.edi_show_cancel_button = any([doc.edi_format_id._needs_web_services()
and doc.state == 'sent'
and move.is_invoice(include_receipts=True)
and move._is_edi_invoice()
and doc.edi_format_id._is_required_for_invoice(move)
for doc in move.edi_document_ids])

Expand All @@ -127,10 +127,23 @@ def _compute_edi_show_abandon_cancel_button(self):
for move in self:
move.edi_show_abandon_cancel_button = any(doc.edi_format_id._needs_web_services()
and doc.state == 'to_cancel'
and move.is_invoice(include_receipts=True)
and move._is_edi_invoice()
and doc.edi_format_id._is_required_for_invoice(move)
for doc in move.edi_document_ids)

def _is_edi_invoice(self):
"""To be overridden for special cases where entry types need to be sent. """
self.ensure_one()
return self._get_edi_document_type() == 'invoice'

def _get_edi_document_type(self, edi_format=None):
"""Defines the document types that are exchanged through the EDI. """
self.ensure_one()
if self.is_invoice(include_receipts=False):
return 'invoice'
elif self.payment_id or self.statement_line_id:
return 'payment'

####################################################
# Export Electronic Document
####################################################
Expand Down Expand Up @@ -503,7 +516,7 @@ def _post(self, soft=True):
edi_document_vals_list = []
for move in posted:
for edi_format in move.journal_id.edi_format_ids:
is_edi_needed = move.is_invoice(include_receipts=False) and edi_format._is_required_for_invoice(move)
is_edi_needed = move._is_edi_invoice() and edi_format._is_required_for_invoice(move)

if is_edi_needed:
errors = edi_format._check_move_configuration(move)
Expand Down Expand Up @@ -565,7 +578,7 @@ def button_cancel_posted_moves(self):
if doc.edi_format_id._needs_web_services() \
and doc.attachment_id \
and doc.state == 'sent' \
and move.is_invoice(include_receipts=True) \
and move._is_edi_invoice() \
and doc.edi_format_id._is_required_for_invoice(move):
to_cancel_documents |= doc
is_move_marked = True
Expand All @@ -582,7 +595,7 @@ def button_abandon_cancel_posted_posted_moves(self):
is_move_marked = False
for doc in move.edi_document_ids:
if doc.state == 'to_cancel' \
and move.is_invoice(include_receipts=True) \
and move._is_edi_invoice() \
and doc.edi_format_id._is_required_for_invoice(move):
documents |= doc
is_move_marked = True
Expand Down
10 changes: 6 additions & 4 deletions addons/l10n_ec/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "Ecuadorian Accounting",
"version": "3.3",
"version": "3.4",
"description": """
Functional
----------
Expand Down Expand Up @@ -32,10 +32,10 @@
* Ecuador banks
* Partners: Consumidor Final, SRI, IESS, and also basic VAT validation
""",
"author": "OPA CONSULTING & TRESCLOUD",
"author": "TRESCLOUD",
"category": "Accounting/Localizations/Account Charts",
"maintainer": "OPA CONSULTING",
"website": "https://opa-consulting.com",
"maintainer": "TRESCLOUD",
"website": "https://www.trescloud.com",
"license": "LGPL-3",
"depends": [
"base",
Expand Down Expand Up @@ -66,6 +66,8 @@
"data/l10n_latam.document.type.csv",
"data/account_chart_template_configure_data.xml",
"data/l10n_ec.sri.payment.csv",
# Views
"views/root_sri_menu.xml",
"views/account_tax_view.xml",
"views/l10n_latam_document_type_view.xml",
"views/l10n_ec_sri_payment.xml",
Expand Down
36 changes: 18 additions & 18 deletions addons/l10n_ec/data/account.account.template.csv
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ ec110401,110401,Seguros pagados por anticipado,TRUE,account.data_account_type_pr
ec110402,110402,Arriendos pagados por anticipado,TRUE,account.data_account_type_prepayments,l10n_ec_ifrs
ec110403,110403,Anticipos a proveedores,TRUE,account.data_account_type_prepayments,l10n_ec_ifrs
ec_other_downpayments,11040401,Otros anticipos entregados,TRUE,account.data_account_type_prepayments,l10n_ec_ifrs
ec_purchase_vat,11050101,Iva pagado en compras locales,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_assets,11050102,Iva pagado en compras locales de activos fijos,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_service_imports,11050103,Iva pagado en importacion de servicios,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_goods_imports,11050104,Iva pagado en importacion de bienes,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_assets_imports,11050105,Iva pagado en importacion de activos fijos,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_sale_vat_outstanding_withholds,11050106,Iva pagado en retenciones de la fuente,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_zero,11050107,Iva en compras 0%,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat,11050101,IVA pagado en compras locales,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_assets,11050102,IVA pagado en compras locales de activos fijos,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_service_imports,11050103,IVA pagado en importacion de servicios,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_goods_imports,11050104,IVA pagado en importacion de bienes,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_assets_imports,11050105,IVA pagado en importacion de activos fijos,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_sale_vat_outstanding_withholds,11050106,IVA pagado en retenciones de la fuente,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_purchase_vat_zero,11050107,IVA en compras 0%,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec110502,110502,Credito tributario a favor de la empresa(i.r.),FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec110503,110503,Anticipo de impuesto a la renta,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
ec_sale_profit_withhold,110504,Retenciones en la fuente pagadas,FALSE,account.data_account_type_current_assets,l10n_ec_ifrs
Expand Down Expand Up @@ -132,11 +132,11 @@ ec2110,2110,Anticipos de clientes,TRUE,account.data_account_type_payable,l10n_ec
ec2111,2111,Pasivos directamente asociados con los activos no corrientes y operaciones discontinuadas,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec211201,211201,Otros beneficios a largo plazo para los empleados,TRUE,account.data_account_type_payable,l10n_ec_ifrs
ec211301,211301,Retenciones judiciales,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat,2114010101,Iva cobrado en ventas locales,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_assets,2114010102,Iva cobrado en ventas de activos fijos,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_goods_exports,2114010103,Iva cobrado en exportacion de bienes,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_services_exports,2114010104,Iva cobrado en exportacion de servicios,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_zero,2114010105,Iva en ventas 0%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat,2114010101,IVA cobrado en ventas locales,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_assets,2114010102,IVA cobrado en ventas de activos fijos,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_goods_exports,2114010103,IVA cobrado en exportacion de bienes,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_services_exports,2114010104,IVA cobrado en exportacion de servicios,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_sale_vat_zero,2114010105,IVA en ventas 0%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ret_ir_1x100,2114010201,Retenciones de la fuente 1%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ret_ir_1_75x100,2114010202,Retenciones de la fuente 1.75%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ret_ir_2x100,2114010203,Retenciones de la fuente 2%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
Expand All @@ -147,12 +147,12 @@ ret_ir_10x100,2114010207,Retenciones de la fuente 10%,FALSE,account.data_account
ret_ir_15x100,2114010208,Retenciones de la fuente 15%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ret_ir_22x100,2114010209,Retenciones de la fuente 22%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ret_ir_others,2114010210,Otras retenciones,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_10,2114010301,Retenciones de iva 10%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_20,2114010302,Retenciones de iva 20%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_30,2114010303,Retenciones de iva 30%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_50,2114010304,Retenciones de iva 50%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_70,2114010305,Retenciones de iva 70%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_100,2114010306,Retenciones de iva 100%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_10,2114010301,Retenciones de IVA 10%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_20,2114010302,Retenciones de IVA 20%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_30,2114010303,Retenciones de IVA 30%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_50,2114010304,Retenciones de IVA 50%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_70,2114010305,Retenciones de IVA 70%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_100,2114010306,Retenciones de IVA 100%,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec_vat_withhold_others,2114010307,Otras retenciones,FALSE,account.data_account_type_current_liabilities,l10n_ec_ifrs
ec2201,2201,Pasivos por contratos de arrendamiento financiero,TRUE,account.data_account_type_payable,l10n_ec_ifrs
ec220201,220201,Cuentas y documentos por pagar locales,TRUE,account.data_account_type_payable,l10n_ec_ifrs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<data noupdate="1">

<record id="l10n_ec_ifrs" model="account.chart.template">
<field name="name">Plan Contable NIIF Ecuador conforme Superintendencia de Compañías</field>
<field name="name">Ecuador - Plan Cuentas NIIF SupCias</field>
<field name="income_currency_exchange_account_id" ref="ec430501"/>
<field name="expense_currency_exchange_account_id" ref="ec520304"/>
<field name="property_account_receivable_id" ref="ec1102050101"/>
Expand Down
Loading