diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5fb2e839b..50ab87bc2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,10 +13,10 @@ on: pull_request: branches: - '[0-9]+.0' - types: [ labeled ] + types: [ opened, synchronize, reopened, labeled ] env: - REQUIRED_MODULES: # list of addional addons to install separated by comma + REQUIRED_MODULES: 'l10n_do' # list of addional addons to install separated by comma TEST_TAGS: '0' jobs: @@ -27,7 +27,7 @@ jobs: get_modules: ${{ steps.get_modules.outputs.modules }} services: db: - image: postgres:13-alpine + image: postgres:13 env: POSTGRES_DB: postgres POSTGRES_USER: odoo diff --git a/README.md b/README.md index 1477f9d8b..afd39ef9d 100644 --- a/README.md +++ b/README.md @@ -47,4 +47,4 @@ Conviértase en sponsor de este proyecto [aquí](https://github.com/sponsors/ind ## Obtener ayuda -Cree un [issue](https://github.com/indexa-git/l10n-dominicana/issues/new/choose) para obtener ayuda! \ No newline at end of file +Cree un [issue](https://github.com/indexa-git/l10n-dominicana/issues/new/choose) para obtener ayuda! diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index be43b2e27..ab2a6cac0 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "16.0.0.0.0", + "version": "16.0.1.0.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded @@ -26,14 +26,14 @@ "views/account_dgii_menuitem.xml", "views/account_journal_views.xml", "views/l10n_latam_document_type_views.xml", - # "views/report_templates.xml", + "views/report_templates.xml", "views/report_invoice.xml", ], # only loaded in demonstration mode "demo": [ "demo/res_partner_demo.xml", ], - "installable": False, + "installable": True, "auto_install": False, "application": False, } diff --git a/l10n_do_accounting/i18n/es_DO.po b/l10n_do_accounting/i18n/es_DO.po index 05ea0fdbe..b054a422f 100644 --- a/l10n_do_accounting/i18n/es_DO.po +++ b/l10n_do_accounting/i18n/es_DO.po @@ -4,229 +4,262 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-06 17:37+0000\n" -"PO-Revision-Date: 2022-04-06 13:39-0400\n" +"POT-Creation-Date: 2023-08-08 20:00+0000\n" +"PO-Revision-Date: 2023-08-08 16:01-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: es_DO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 3.0.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.3.2\n" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "%s is not a stored field" msgstr "%s no es un campo almacenado" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "01 - Operational Incomes" msgstr "01 - Ingresos por Operaciones (No Financieros)" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "01 - Personal" msgstr "01 - Gastos de Personal" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "01 - Pre-printed Invoice Impairment" msgstr "01 - Deterioro de Factura Pre-impresa" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "01 - Total Cancellation" msgstr "01 - Anulación total" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "02 - Financial Incomes" msgstr "02 - Ingresos Financieros" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "02 - Printing Errors (Pre-printed Invoice)" msgstr "02 - Errores de Impresión (Factura Pre-impresa)" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "02 - Text Correction" msgstr "02 - Corrección de Texto" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "02 - Work, Supplies and Services" msgstr "02 - Gastos por Trabajo, Suministros y Servicio" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "03 - Amount correction" msgstr "03 - Corrección de Monto" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "03 - Defective Printing" msgstr "03 - Impresión Defectuosa" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "03 - Extraordinary Incomes" msgstr "03 - Ingresos Extraordinarios" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "03 - Leasing" msgstr "03 - Arrendamientos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "04 - Correction of Product Information" msgstr "04 - Corrección de la Información" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "04 - Fixed Assets" msgstr "04 - Gastos de Activos Fijos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "04 - Leasing Incomes" msgstr "04 - Ingresos por Arrendamientos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "04 - NCF replacement issued in contingency" msgstr "04 - Reemplazo NCF emitido en contingencia" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "05 - Income for Selling Depreciable Assets" msgstr "05 - Ingresos por Venta de Activo Depreciable" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "05 - Product Change" msgstr "05 - Cambio de Productos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "05 - Reference Electronic Consumer Invoice" msgstr "05 - Referencia Factura Consumo Electrónica" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "05 - Representation" msgstr "05 - Gastos de Representación" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "06 - Admitted Deductions" msgstr "06 - Otras Deducciones Admitidas" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "06 - Other Incomes" msgstr "06 - Otros Ingresos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "06 - Product Return" msgstr "06 - Devolución de Productos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "07 - Financial Expenses" msgstr "07 - Gastos Financieros" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "07 - Product Omission" msgstr "07 - Omisión de Productos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "08 - Extraordinary Expenses" msgstr "08 - Gastos Extraordinarios" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "08 - NCF Sequence Errors" msgstr "08 - Errores en Secuencia de NCF" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "09 - Cost & Expenses part of Sales" msgstr "09 - Compras y Gastos que forman parte del Costo de Venta" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "09 - For Cessation of Operations" msgstr "09 - Por Cese de Operaciones" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "10 - Assets Acquisitions" msgstr "10 - Adquisiciones de Activos" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "10 - Lossing or Hurting Of Counterfoil" msgstr "10 - Pérdida o Hurto de Talonarios" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "11 - Insurance Expenses" msgstr "11 - Gastos de Seguros" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "" "
\n" -" Código Modificación:" +" Código Modificación:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "" "
\n" -" Contacto:" +" Contacto:" msgstr "" #. module: l10n_do_accounting @@ -247,11 +280,24 @@ msgstr "" #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited -msgid "Monto descuento" +msgid "" +"\n" +" E\n" +" " +msgstr "" + +#. module: l10n_do_accounting +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations +msgid "/" msgstr "" #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +msgid "Monto descuento" +msgstr "" + +#. module: l10n_do_accounting +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Cel.:" msgstr "" @@ -261,7 +307,7 @@ msgid "Código de Seguridad:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Fecha Emisión:" msgstr "" @@ -271,36 +317,42 @@ msgid "Fecha Firma Digital:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "NCF modificado:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Origen:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "RNC:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Referencia:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Tel.:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.document_tax_totals +msgid "Total" +msgstr "" + +#. module: l10n_do_accounting +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Vence:" msgstr "" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "A VAT is mandatory for this type of NCF. Please set the current VAT of this client" @@ -334,10 +386,11 @@ msgid "Add Debit Note wizard" msgstr "Asistente para agregar nota débito" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note__l10n_do_amount -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__amount +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__l10n_do_amount #, python-format msgid "Amount" msgstr "Importe" @@ -354,12 +407,14 @@ msgstr "" "move, podría ser relativo a otros modelos, como por ejemplo stock.picking)" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "Apply debit" msgstr "Aplicar débito" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Bonds or Gift Certificate" @@ -424,18 +479,21 @@ msgid "Cancellation Type" msgstr "Tipo de anulación" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Cannot create chart of account until you configure your VAT." msgstr "No puede crear un Catálogo de Cuentas hasta no establecer su RNC." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Cash" msgstr "Efectivo" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Check / Transfer" @@ -446,6 +504,11 @@ msgstr "Cheque / Transferencia" msgid "Companies" msgstr "Compañías" +#. module: l10n_do_accounting +#: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_do_account_journal_document_type__company_id +msgid "Company" +msgstr "Compañía" + #. module: l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_bank_statement_line__l10n_do_company_in_contingency #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__l10n_do_company_in_contingency @@ -453,6 +516,11 @@ msgstr "Compañías" msgid "Company in contingency" msgstr "Compañía en contingencia" +#. module: l10n_do_accounting +#: model:ir.model.fields,help:l10n_do_accounting.field_l10n_do_account_journal_document_type__company_id +msgid "Company related to this journal" +msgstr "Empresa relacionada con este diario" + #. module: l10n_do_accounting #: model:ir.model,name:l10n_do_accounting.model_res_partner msgid "Contact" @@ -496,19 +564,22 @@ msgid "Created on" msgstr "Creado el" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 +#: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #, python-format msgid "Credit" msgstr "Crédito" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Credit Card" msgstr "Tarjeta Crédito / Débito" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Cédula:" msgstr "" @@ -517,6 +588,13 @@ msgstr "" msgid "DGII" msgstr "" +#. module: l10n_do_accounting +#. odoo-python +#: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 +#, python-format +msgid "Debit" +msgstr "Débito" + #. module: l10n_do_accounting #: model:ir.model.fields,help:l10n_do_accounting.field_account_debit_note__l10n_do_amount msgid "Debit Note based fixed amount" @@ -554,17 +632,8 @@ msgid "Deferred submissions" msgstr "Envío diferido" #. module: l10n_do_accounting -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_journal__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__display_name #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_cancel__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_line__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_resequence_wizard__display_name #: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_do_account_journal_document_type__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_latam_document_type__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_company__display_name -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_partner__display_name msgid "Display Name" msgstr "Nombre mostrado" @@ -604,6 +673,7 @@ msgid "Dominican Localization" msgstr "Localización dominicana" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "Draft debit" @@ -660,64 +730,62 @@ msgid "Fiscal Number" msgstr "Número de Comprobante Fiscal" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "Fiscal Tax Payer" msgstr "Contribuyente" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "Fiscal invoices require partner fiscal type" msgstr "Las Facturas Fiscales requieren un Tipo de Contribuyente en el contacto" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_resequence.py:0 #, python-format msgid "Fiscal invoices resequence is not allowed." msgstr "La secuenciación de Facturas Fiscales no está permitido" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "Foreigner" msgstr "Extranjero" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #, python-format msgid "Full Refund" msgstr "Reembolso completo" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Go to Companies" msgstr "Ir a Compañías" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "Governmental" msgstr "Gubernamental" #. module: l10n_do_accounting -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_journal__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__id #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_cancel__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_line__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_resequence_wizard__id #: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_do_account_journal_document_type__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_latam_document_type__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_company__id -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_partner__id msgid "ID" msgstr "Identificación" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "ID Cliente:" msgstr "" @@ -791,6 +859,11 @@ msgstr "Asiento contable" msgid "Journal Item" msgstr "Apunte contable" +#. module: l10n_do_accounting +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__l10n_do_refund_type +msgid "L10N Do Refund Type" +msgstr "Tipo de devolución" + #. module: l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_bank_statement_line__l10n_do_sequence_number #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__l10n_do_sequence_number @@ -811,17 +884,8 @@ msgid "L10N Latam Country Code" msgstr "Código de País" #. module: l10n_do_accounting -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_journal____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move____last_update #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_cancel____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_line____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_resequence_wizard____last_update #: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_do_account_journal_document_type____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_l10n_latam_document_type____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_company____last_update -#: model:ir.model.fields,field_description:l10n_do_accounting.field_res_partner____last_update msgid "Last Modified on" msgstr "Última modificación el" @@ -842,6 +906,11 @@ msgstr "Última actualización en" msgid "Latam Document Type" msgstr "Tipo de Comprobante" +#. module: l10n_do_accounting +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.custom_header +msgid "Logo" +msgstr "" + #. module: l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_bank_statement_line__l10n_latam_manual_document_number #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__l10n_latam_manual_document_number @@ -857,16 +926,17 @@ msgid "Modifies" msgstr "Afecta a" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.document_tax_totals msgid "Monto Exento" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.document_tax_totals msgid "Monto Gravado" msgstr "" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/l10n_latam_document_type.py:0 #, python-format msgid "NCF %s doesn't have the correct structure" @@ -899,28 +969,31 @@ msgstr "" "responsabilidad tanto del emisor como del receptor del documento" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "NCF:" msgstr "" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "No invoice found for this operation" msgstr "No se encontró facturas para esta operación" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Nombre:" msgstr "" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "Non Tax Payer" msgstr "Cliente de Consumo" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "Nonprofit Organization" @@ -945,22 +1018,25 @@ msgstr "" "Facturas Electrónicas. La emisión de NCF ha sido habilitada." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Other Sale Type" msgstr "Otras Formas de Venta" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #, python-format msgid "Partial Refund" msgstr "Reembolso Parcial" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format -msgid "Partner %s is needed to issue a fiscal invoice" -msgstr "El %s del contacto es necesario para emitir una factura fiscal" +msgid "Partner (%s) %s is needed to issue a fiscal invoice" +msgstr "El contacto (%s) requiere un %s para emitir una factura fiscal" #. module: l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_journal__l10n_do_payment_form @@ -968,21 +1044,22 @@ msgid "Payment Form" msgstr "Forma de Pago" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note__l10n_do_percentage -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__percentage +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__l10n_do_percentage #, python-format msgid "Percentage" msgstr "Porcentaje" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "RNC:" msgstr "" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Razón Social:" msgstr "" @@ -992,20 +1069,16 @@ msgid "Record a new vendor debit note" msgstr "Registrar una nueva Nota de Débito del proveedor" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "Refund" msgstr "Reembolso" #. module: l10n_do_accounting -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__refund_action +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__l10n_do_refund_action msgid "Refund Action" -msgstr "Reembolso" - -#. module: l10n_do_accounting -#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move_reversal__refund_type -msgid "Refund Type" -msgstr "Tipo de Reembolso" +msgstr "Tipo de devolución" #. module: l10n_do_accounting #: model:ir.model,name:l10n_do_accounting.model_account_resequence_wizard @@ -1013,6 +1086,7 @@ msgid "Remake the sequence of Journal Entries." msgstr "Haz de nuevo la secuencia de asientos de diario." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_move_cancel.py:0 #, python-format msgid "Selected invoice(s) cannot be cancelled as they are already in 'Cancelled' state." @@ -1021,6 +1095,7 @@ msgstr "" "Cancelado." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_move_cancel.py:0 #, python-format msgid "Selected invoice(s) cannot be cancelled as they are already in 'Paid' state." @@ -1050,6 +1125,7 @@ msgid "Supplier Invoices" msgstr "Facturas de Proveedor" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_journal.py:0 #, python-format msgid "Swap" @@ -1079,6 +1155,7 @@ msgid "Technical field used to hide/show fields regarding the localization" msgstr "Campo técnico usado para mostrar/ocultar campos dependiendo la localización" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "There is already a sale invoice with fiscal number %s" @@ -1120,7 +1197,7 @@ msgid "Valid until" msgstr "Válida hasta" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Vencimiento e-NCF:" msgstr "" @@ -1131,7 +1208,7 @@ msgid "Vendor Debit Notes" msgstr "Notas de Débito de Proveedor" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "Válida hasta:" msgstr "" @@ -1141,24 +1218,28 @@ msgid "When activating this field, NCF issuance is disabled." msgstr "Cuando este campo es activado, la emisión de NCF es deshabilitada." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "You are not allowed to cancel Fiscal Invoices" msgstr "No tiene permitido cancelar Facturas Fiscales" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "You are not allowed to issue Debit Notes" msgstr "No tiene permitido emitir Notas de Débito" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "You are not allowed to issue Fiscal Credit Notes" msgstr "No tiene permitido emitir Notas de Crédito Fiscales" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "You are not allowed to modify %s after partner fiscal document issuing" @@ -1167,30 +1248,35 @@ msgstr "" "de este contacto" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "You cannot cancel multiple fiscal invoices at a time." msgstr "No puede cancelar múltiples facturas fiscales a la vez." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 #, python-format msgid "You cannot create Credit Notes from multiple documents at a time." msgstr "No puede crear Notas de Crédito desde múltiples documentos a la vez." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "You cannot create Debit Notes from multiple documents at a time." msgstr "No puede crear Notas de Débito desde múltiples facturas a la vez." #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/account_move.py:0 #, python-format msgid "You cannot delete fiscal invoice which have been posted before" msgstr "No puede eliminar una factura fiscal que ha sido validada anteriormente" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 #, python-format msgid "You cannot issue Credit/Debit Notes for %s document type" @@ -1238,11 +1324,12 @@ msgid "e-CF Sign Date" msgstr "Fecha Firmado e-CF" #. module: l10n_do_accounting -#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.report_invoice_document_inherited +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations msgid "e-NCF:" msgstr "" #. module: l10n_do_accounting +#. odoo-python #: code:addons/l10n_do_accounting/models/res_partner.py:0 #, python-format msgid "special from Tax Paying" diff --git a/l10n_do_accounting/models/account_journal.py b/l10n_do_accounting/models/account_journal.py index 4e6146d24..567f85cab 100644 --- a/l10n_do_accounting/models/account_journal.py +++ b/l10n_do_accounting/models/account_journal.py @@ -6,7 +6,7 @@ class AccountJournal(models.Model): _inherit = "account.journal" def _get_l10n_do_payment_form(self): - """ Return the list of payment forms allowed by DGII. """ + """Return the list of payment forms allowed by DGII.""" return [ ("cash", _("Cash")), ("bank", _("Check / Transfer")), @@ -42,11 +42,8 @@ def _get_all_ncf_types(self, types_list, invoice=False): # create fiscal sequences return types_list + ecf_types - if ( - invoice.is_purchase_document() - and invoice.partner_id.l10n_do_dgii_tax_payer_type - and invoice.partner_id.l10n_do_dgii_tax_payer_type - in ("non_payer", "foreigner") + if invoice.is_purchase_document() and any( + t in types_list for t in ("minor", "informal", "exterior") ): # Return ncf/ecf types depending on company ECF issuing status return ecf_types if self.company_id.l10n_do_ecf_issuer else types_list @@ -117,14 +114,20 @@ def _get_journal_ncf_types(self, counterpart_partner=False, invoice=False): ) return self._get_all_ncf_types(res) if counterpart_partner.l10n_do_dgii_tax_payer_type: - counterpart_ncf_types = ncf_types_data[ - "issued" if self.type == "sale" else "received" - ][counterpart_partner.l10n_do_dgii_tax_payer_type] - ncf_types = list(set(ncf_types) & set(counterpart_ncf_types)) + if counterpart_partner == self.company_id.partner_id: + ncf_types = ["minor"] + else: + counterpart_ncf_types = ncf_types_data[ + "issued" if self.type == "sale" else "received" + ][counterpart_partner.l10n_do_dgii_tax_payer_type] + ncf_types = list(set(ncf_types) & set(counterpart_ncf_types)) else: raise ValidationError( - _("Partner %s is needed to issue a fiscal invoice") - % counterpart_partner._fields["l10n_do_dgii_tax_payer_type"].string + _("Partner (%s) %s is needed to issue a fiscal invoice") + % ( + counterpart_partner.id, + counterpart_partner._fields["l10n_do_dgii_tax_payer_type"].string, + ) ) if invoice and invoice.move_type in ["out_refund", "in_refund"]: ncf_types = ["credit_note"] @@ -142,7 +145,9 @@ def _get_journal_codes(self): self.ensure_one() if self.type == "purchase": return [] - return ["E"] if self.company_id.l10n_do_ecf_issuer else ["B"] + elif self.type == "sale" and self.company_id.l10n_do_ecf_issuer: + return ["E"] + return ["B"] def _l10n_do_create_document_types(self): self.ensure_one() @@ -183,11 +188,14 @@ def _l10n_do_create_document_types(self): ) ) - @api.model - def create(self, values): - res = super().create(values) - res._l10n_do_create_document_types() - return res + @api.model_create_multi + def create(self, vals_list): + journals = super(AccountJournal, self).create(vals_list) + + for journal in journals: + journal._l10n_do_create_document_types() + + return journals def write(self, values): to_check = {"type", "l10n_latam_use_documents"} diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 62afad09a..9bc397b57 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -8,12 +8,13 @@ class AccountMove(models.Model): _inherit = "account.move" + _rec_names_search = ["l10n_do_fiscal_number"] _l10n_do_sequence_field = "l10n_do_fiscal_number" _l10n_do_sequence_fixed_regex = r"^(?P.*?)(?P\d{0,8})$" def _get_l10n_do_cancellation_type(self): - """ Return the list of cancellation types required by DGII. """ + """Return the list of cancellation types required by DGII.""" return [ ("01", _("01 - Pre-printed Invoice Impairment")), ("02", _("02 - Printing Errors (Pre-printed Invoice)")), @@ -28,7 +29,7 @@ def _get_l10n_do_cancellation_type(self): ] def _get_l10n_do_ecf_modification_code(self): - """ Return the list of e-CF modification codes required by DGII. """ + """Return the list of e-CF modification codes required by DGII.""" return [ ("1", _("01 - Total Cancellation")), ("2", _("02 - Text Correction")), @@ -38,7 +39,7 @@ def _get_l10n_do_ecf_modification_code(self): ] def _get_l10n_do_income_type(self): - """ Return the list of income types required by DGII. """ + """Return the list of income types required by DGII.""" return [ ("01", _("01 - Operational Incomes")), ("02", _("02 - Financial Incomes")), @@ -107,7 +108,7 @@ def _get_l10n_do_income_type(self): ) l10n_do_fiscal_number = fields.Char( "Fiscal Number", - index=True, + index="trigram", tracking=True, copy=False, help="Stored field equivalent of l10n_latam_document number", @@ -119,7 +120,6 @@ def _get_l10n_do_income_type(self): l10n_latam_manual_document_number = fields.Boolean(store=True) def init(self): - super(AccountMove, self).init() if not self._abstract and self._sequence_index: @@ -186,55 +186,21 @@ def _compute_l10n_do_enable_first_sequence(self): (self - l10n_do_internal_invoices).l10n_do_enable_first_sequence = False - def _get_l10n_do_amounts(self, company_currency=False): + def _get_l10n_do_amounts(self): """ - Method used to to prepare dominican fiscal invoices amounts data. Widely used + Method used to prepare dominican fiscal invoices amounts data. Widely used on reports and electronic invoicing. - - Returned values: - - itbis_amount: Total ITBIS - itbis_taxable_amount: Monto Gravado Total (con ITBIS) - itbis_exempt_amount: Monto Exento """ self.ensure_one() - amount_field = company_currency and "balance" or "price_subtotal" - sign = -1 if (company_currency and self.is_inbound()) else 1 - - itbis_tax_group = self.env.ref("l10n_do.group_itbis", False) - - taxed_move_lines = self.line_ids.filtered("tax_line_id") - itbis_taxed_move_lines = taxed_move_lines.filtered( - lambda l: itbis_tax_group in l.tax_line_id.mapped("tax_group_id") - and l.tax_line_id.amount > 0 - ) - - itbis_taxed_product_lines = self.invoice_line_ids.filtered( - lambda l: itbis_tax_group in l.tax_ids.mapped("tax_group_id") - ) - return { - "itbis_amount": sign * sum(itbis_taxed_move_lines.mapped(amount_field)), - "itbis_taxable_amount": sign - * sum( - line[amount_field] - for line in itbis_taxed_product_lines - if line.price_total != line.price_subtotal - ), - "itbis_exempt_amount": sign - * sum( - line[amount_field] - for line in itbis_taxed_product_lines - if any(True for tax in line.tax_ids if tax.amount == 0) - ), - } + return self.line_ids._get_l10n_do_line_amounts() @api.depends( "company_id", - "l10n_latam_document_type_id.l10n_do_ncf_type", + "l10n_latam_document_type_id", ) def _compute_is_ecf_invoice(self): - for invoice in self: + for invoice in self.filtered(lambda inv: inv.state == "draft"): invoice.is_ecf_invoice = ( invoice.company_id.country_id and invoice.company_id.country_id.code == "DO" @@ -245,27 +211,37 @@ def _compute_is_ecf_invoice(self): @api.depends("company_id", "company_id.l10n_do_ecf_issuer") def _compute_company_in_contingency(self): - for invoice in self: - ecf_invoices = self.search( - [("is_ecf_invoice", "=", True)], limit=1 - ).filtered(lambda i: not i.l10n_latam_manual_document_number) + ecf_invoices = self.search( + [ + ("is_ecf_invoice", "=", True), + ], + limit=1, + ).filtered(lambda i: not i.l10n_latam_manual_document_number) + + # first set all invoices l10n_do_company_in_contingency = False + self.write({"l10n_do_company_in_contingency": False}) + + # then get draft invoices and do the thing + for invoice in self.filtered(lambda inv: inv.state == "draft"): invoice.l10n_do_company_in_contingency = bool( ecf_invoices and not invoice.company_id.l10n_do_ecf_issuer ) @api.depends("l10n_do_ecf_security_code", "l10n_do_ecf_sign_date", "invoice_date") - @api.depends_context("l10n_do_ecf_service_env") def _compute_l10n_do_electronic_stamp(self): - l10n_do_ecf_invoice = self.filtered( lambda i: i.is_ecf_invoice and not i.l10n_latam_manual_document_number and i.l10n_do_ecf_security_code + and i.state == "posted" ) for invoice in l10n_do_ecf_invoice: + if hasattr(invoice.company_id, "l10n_do_ecf_service_env"): + ecf_service_env = invoice.company_id.l10n_do_ecf_service_env + else: + ecf_service_env = "TesteCF" - ecf_service_env = self.env.context.get("l10n_do_ecf_service_env", "CerteCF") doc_code_prefix = invoice.l10n_latam_document_type_id.doc_code_prefix is_rfc = ( # Es un Resumen Factura Consumo doc_code_prefix == "E32" and invoice.amount_total_signed < 250000 @@ -289,18 +265,17 @@ def _compute_l10n_do_electronic_stamp(self): invoice.invoice_date or fields.Date.today() ).strftime("%d-%m-%Y") - l10n_do_amounts = invoice._get_l10n_do_amounts(company_currency=True) - l10n_do_total = ( - l10n_do_amounts["itbis_taxable_amount"] - + l10n_do_amounts["itbis_amount"] - ) + total_field = "l10n_do_invoice_total" + if invoice.currency_id != invoice.company_id.currency_id: + total_field += "_currency" + l10n_do_total = invoice._get_l10n_do_amounts()[total_field] qr_string += "MontoTotal=%s&" % ("%f" % l10n_do_total).rstrip("0").rstrip( "." ) if not is_rfc: qr_string += "FechaFirma=%s&" % invoice.l10n_do_ecf_sign_date.strftime( - "%d-%m-%Y%%20%H:%M:%S" + "%d-%m-%Y %H:%M:%S" ) special_chars = " !#$&'()*+,/:;=?@[]\"-.<>\\^_`" @@ -312,7 +287,7 @@ def _compute_l10n_do_electronic_stamp(self): ) qr_string += "CodigoSeguridad=%s" % security_code - invoice.l10n_do_electronic_stamp = urls.url_quote_plus(qr_string) + invoice.l10n_do_electronic_stamp = urls.url_quote_plus(qr_string, safe="%") (self - l10n_do_ecf_invoice).l10n_do_electronic_stamp = False @@ -325,7 +300,7 @@ def _check_unique_sequence_number(self): and inv.state == "posted" ) if l10n_do_invoices: - self.flush( + self.flush_model( ["name", "journal_id", "move_type", "state", "l10n_do_fiscal_number"] ) self._cr.execute( @@ -361,7 +336,6 @@ def _compute_l10n_latam_document_number(self): super(AccountMove, self - l10n_do_recs)._compute_l10n_latam_document_number() def button_cancel(self): - fiscal_invoice = self.filtered( lambda inv: inv.country_code == "DO" and self.move_type[-6:] in ("nvoice", "refund") @@ -389,7 +363,6 @@ def button_cancel(self): return super(AccountMove, self).button_cancel() def action_reverse(self): - fiscal_invoice = self.filtered( lambda inv: inv.country_code == "DO" and self.move_type[-6:] in ("nvoice", "refund") @@ -459,6 +432,7 @@ def _check_invoice_type_document_type(self): lambda inv: inv.country_code == "DO" and inv.l10n_latam_use_documents and inv.l10n_latam_document_type_id + and inv.state == "posted" ) for rec in l10n_do_invoices: has_vat = bool(rec.partner_id.vat and bool(rec.partner_id.vat.strip())) @@ -496,7 +470,6 @@ def _onchange_partner_id(self): return super(AccountMove, self)._onchange_partner_id() def _reverse_move_vals(self, default_values, cancel=True): - ctx = self.env.context amount = ctx.get("amount") percentage = ctx.get("percentage") @@ -562,7 +535,6 @@ def _is_l10n_do_manual_document_number(self): ) def _get_debit_line_tax(self, debit_date): - if self.move_type == "out_invoice": return ( self.company_id.account_sale_tax_id @@ -576,55 +548,7 @@ def _get_debit_line_tax(self, debit_date): "l10n_do.%s_tax_0_purch" % self.company_id.id ) - def _move_autocomplete_invoice_lines_create(self, vals_list): - - ctx = self.env.context - refund_type = ctx.get("refund_type") - refund_debit_type = ctx.get("l10n_do_debit_type", refund_type) - if refund_debit_type and refund_debit_type in ("percentage", "fixed_amount"): - for vals in vals_list: - del vals["line_ids"] - origin_invoice_id = self.browse(self.env.context.get("active_ids")) - taxes = ( - [ - ( - 6, - 0, - [ - origin_invoice_id._get_debit_line_tax( - vals["invoice_date"] - ).id - ], - ) - ] - if ctx.get("l10n_do_debit_type", False) - else [(5, 0)] - ) - price_unit = ( - ctx.get("amount") - if refund_debit_type == "fixed_amount" - else origin_invoice_id.amount_untaxed - * (ctx.get("percentage") / 100) - ) - vals["invoice_line_ids"] = [ - ( - 0, - 0, - { - "name": ctx.get("reason") or _("Refund"), - "price_unit": price_unit, - "quantity": 1, - "tax_ids": taxes, - }, - ) - ] - - return super(AccountMove, self)._move_autocomplete_invoice_lines_create( - vals_list - ) - def _post(self, soft=True): - res = super()._post(soft) l10n_do_invoices = self.filtered( @@ -728,7 +652,6 @@ def _compute_split_sequence(self): record.l10n_do_sequence_number = int(matching.group(1) or 0) def _get_last_sequence(self, relaxed=False, with_prefix=None, lock=True): - if not self._context.get("is_l10n_do_seq", False): return super(AccountMove, self)._get_last_sequence( relaxed=relaxed, with_prefix=with_prefix, lock=lock @@ -765,7 +688,7 @@ def _get_last_sequence(self, relaxed=False, with_prefix=None, lock=True): field=self._l10n_do_sequence_field, ) - self.flush( + self.flush_model( [ self._l10n_do_sequence_field, "l10n_do_sequence_number", @@ -776,7 +699,6 @@ def _get_last_sequence(self, relaxed=False, with_prefix=None, lock=True): return (self.env.cr.fetchone() or [None])[0] def _get_sequence_format_param(self, previous): - if not self._context.get("is_l10n_do_seq", False): return super(AccountMove, self)._get_sequence_format_param(previous) @@ -810,7 +732,11 @@ def _set_next_sequence(self): format_values["seq"] = 0 format_values["seq"] = format_values["seq"] + 1 - if self.state != "draft" and not self[self._l10n_do_sequence_field]: + if ( + self.env.context.get("prefetch_seq") + or self.state != "draft" + and not self[self._l10n_do_sequence_field] + ): self[ self._l10n_do_sequence_field ] = self.l10n_latam_document_type_id._format_document_number( diff --git a/l10n_do_accounting/models/account_move_line.py b/l10n_do_accounting/models/account_move_line.py index 1c166e42d..0addbe2a8 100644 --- a/l10n_do_accounting/models/account_move_line.py +++ b/l10n_do_accounting/models/account_move_line.py @@ -35,7 +35,6 @@ def _get_price_total_and_subtotal( ) if self.move_id.is_ecf_invoice: - line_itbis_taxes = self.tax_ids.filtered( lambda t: t.tax_group_id == self.env.ref("l10n_do.group_itbis") ) @@ -47,3 +46,117 @@ def _get_price_total_and_subtotal( [t["amount"] for t in itbis_taxes_data["taxes"]] ) return res + + def _get_l10n_do_line_amounts(self): + group_itbis = self.env.ref("l10n_do.group_itbis") + group_isr = self.env.ref("l10n_do.group_isr") + + tax_lines = self.filtered( + lambda x: x.tax_group_id.id + in [ + group_itbis.id, + group_isr.id, + ] + ) + itbis_tax_lines = tax_lines.filtered( + lambda line: line.tax_group_id == group_itbis + ) + isr_tax_lines = tax_lines.filtered(lambda line: line.tax_group_id == group_isr) + + invoice_line_ids = self.filtered(lambda x: x.display_type == "product") + taxed_lines = invoice_line_ids.filtered( + lambda x: x.tax_ids and any(tax for tax in x.tax_ids if tax.amount) + ) + exempt_lines = invoice_line_ids.filtered( + lambda x: not x.tax_ids or any(tax for tax in x.tax_ids if not tax.amount) + ) + itbis_taxed_lines = taxed_lines.filtered( + lambda line: group_itbis in line.tax_ids.mapped("tax_group_id") + ) + isr_taxed_lines = taxed_lines.filtered( + lambda line: group_isr in line.tax_ids.mapped("tax_group_id") + ) + + itbis_tax_amount_map = { + "18": (18, 1.8), + "16": (16, 1.6), + } + + result = { + "base_amount": sum(taxed_lines.mapped("price_subtotal")), + "exempt_amount": sum(exempt_lines.mapped("price_subtotal")), + "itbis_18_tax_amount": sum( + self.currency_id.round(line.amount_currency) + for line in itbis_tax_lines.filtered( + lambda tl: tl.tax_line_id.amount in itbis_tax_amount_map["18"] + ) + ), + "itbis_18_base_amount": sum( + itbis_taxed_lines.filtered( + lambda line: any( + tax + for tax in line.tax_ids + if tax.amount in itbis_tax_amount_map["18"] + ) + ).mapped("amount_currency") + ), + "itbis_16_tax_amount": sum( + self.currency_id.round(line.amount_currency) + for line in itbis_tax_lines.filtered( + lambda tl: tl.tax_line_id.amount in itbis_tax_amount_map["16"] + ) + ), + "itbis_16_base_amount": sum( + itbis_taxed_lines.filtered( + lambda line: any( + tax + for tax in line.tax_ids + if tax.amount in itbis_tax_amount_map["16"] + ) + ).mapped("amount_currency") + ), + "itbis_0_tax_amount": 0, # not supported + "itbis_0_base_amount": 0, # not supported + "itbis_withholding_amount": sum( + self.currency_id.round(line.amount_currency) + for line in itbis_tax_lines.filtered( + lambda tl: tl.tax_line_id.amount < 0 + ) + ), + "itbis_withholding_base_amount": sum( + itbis_taxed_lines.filtered( + lambda line: any(tax for tax in line.tax_ids if tax.amount < 0) + ).mapped("amount_currency") + ), + "isr_withholding_amount": sum( + self.currency_id.round(line.amount_currency) + for line in isr_tax_lines.filtered(lambda tl: tl.tax_line_id.amount < 0) + ), + "isr_withholding_base_amount": sum( + isr_taxed_lines.filtered( + lambda line: any(tax for tax in line.tax_ids if tax.amount < 0) + ).mapped("amount_currency") + ), + } + + # convert values to positives + for key, value in result.items(): + result[key] = abs(value) + + result["l10n_do_invoice_total"] = ( + self.move_id.amount_untaxed + + result["itbis_18_tax_amount"] + + result["itbis_16_tax_amount"] + + result["itbis_0_tax_amount"] + ) + + if self.currency_id != self.company_id.currency_id: + rate = (self.currency_id + self.company_id.currency_id)._get_rates( + self.company_id, self.move_id.date + ).get(self.currency_id.id) or 1 + currency_vals = {} + for k, v in result.items(): + currency_vals[k + "_currency"] = v / rate + result.update(currency_vals) + + return result diff --git a/l10n_do_accounting/models/res_company.py b/l10n_do_accounting/models/res_company.py index 7707dc171..6b7448e07 100644 --- a/l10n_do_accounting/models/res_company.py +++ b/l10n_do_accounting/models/res_company.py @@ -23,7 +23,7 @@ class ResCompany(models.Model): ) def _localization_use_documents(self): - """ Dominican localization uses documents """ + """Dominican localization uses documents""" self.ensure_one() return ( True diff --git a/l10n_do_accounting/models/res_partner.py b/l10n_do_accounting/models/res_partner.py index 4ca460e54..3ef1cc4f2 100644 --- a/l10n_do_accounting/models/res_partner.py +++ b/l10n_do_accounting/models/res_partner.py @@ -54,7 +54,6 @@ def _get_l10n_do_expense_type(self): ) def _check_l10n_do_fiscal_fields(self, vals): - if not self or self.parent_id: # Do not perform any check because child contacts # have readonly fiscal field. This also allows set @@ -93,7 +92,6 @@ def _check_l10n_do_fiscal_fields(self, vals): ) def write(self, vals): - res = super(Partner, self).write(vals) self._check_l10n_do_fiscal_fields(vals) @@ -101,7 +99,7 @@ def write(self, vals): @api.depends("vat", "country_id", "name") def _compute_l10n_do_dgii_payer_type(self): - """ Compute the type of partner depending on soft decisions""" + """Compute the type of partner depending on soft decisions""" company_id = self.env["res.company"].search( [("id", "=", self.env.user.company_id.id)] ) diff --git a/l10n_do_accounting/tests/common.py b/l10n_do_accounting/tests/common.py index 20e1e088b..56f796d37 100644 --- a/l10n_do_accounting/tests/common.py +++ b/l10n_do_accounting/tests/common.py @@ -1,9 +1,7 @@ -from odoo.tests import tagged from odoo.tests.common import Form from odoo.addons.account.tests.common import AccountTestInvoicingCommon -@tagged("external_l10n", "post_install", "-at_install", "-standard", "external") class L10nDOTestsCommon(AccountTestInvoicingCommon): @classmethod def setUpClass(cls, chart_template_ref="l10n_do.do_chart_template"): @@ -13,6 +11,7 @@ def setUpClass(cls, chart_template_ref="l10n_do.do_chart_template"): "INDEXA SRL", chart_template=cls.env.ref(chart_template_ref), vat="131793916", + street="dummy address", country_id=cls.env.ref("base.do").id, )["company"] cls.fiscal_partner = cls.env["res.partner"].create( @@ -141,6 +140,5 @@ def _create_l10n_do_invoice(self, data=None, invoice_type="out_invoice"): ) for tax in taxes: invoice_line_form.tax_ids.add(tax) - invoice_form.invoice_date = invoice_form.date invoice = invoice_form.save() return invoice diff --git a/l10n_do_accounting/tests/test_account_journal.py b/l10n_do_accounting/tests/test_account_journal.py index 9278f9ead..c47ec6ebd 100644 --- a/l10n_do_accounting/tests/test_account_journal.py +++ b/l10n_do_accounting/tests/test_account_journal.py @@ -3,7 +3,7 @@ from odoo.exceptions import RedirectWarning -@tagged("post_install") +@tagged("-at_install", "post_install") class AccountJournalTest(common.L10nDOTestsCommon): def test_001_raise_redirect(self): """ diff --git a/l10n_do_accounting/tests/test_account_move.py b/l10n_do_accounting/tests/test_account_move.py index a7753ace6..45ebe8869 100644 --- a/l10n_do_accounting/tests/test_account_move.py +++ b/l10n_do_accounting/tests/test_account_move.py @@ -4,7 +4,7 @@ from odoo.exceptions import ValidationError -@tagged("post_install") +@tagged("-at_install", "post_install") class AccountMoveTest(common.L10nDOTestsCommon): def test_001_invoice_ncf_types(self): """ @@ -43,8 +43,8 @@ def test_001_invoice_ncf_types(self): ) .create( { - "refund_type": "percentage", - "percentage": "5", + "l10n_do_refund_type": "percentage", + "l10n_do_percentage": "5", "journal_id": ncf_sale_credito_fiscal_invoice[0].journal_id.id, } ) @@ -159,6 +159,7 @@ def test_001_invoice_ncf_types(self): data={ "document_number": "B0100000001", "expense_type": "02", + "invoice_date": fields.Date.today(), }, invoice_type="in_invoice", ) @@ -186,8 +187,8 @@ def test_001_invoice_ncf_types(self): ) .create( { - "refund_type": "percentage", - "percentage": "5", + "l10n_do_refund_type": "percentage", + "l10n_do_percentage": "5", "l10n_latam_document_number": "B0400000001", "journal_id": ncf_purchase_credito_fiscal_invoice[0].journal_id.id, } @@ -209,39 +210,35 @@ def test_001_invoice_ncf_types(self): "document type", ) - # TODO: revisar estos test. - # Está provocando error en - # odoo//addons/l10n_latam_invoice_document/models/account_move.py#L224 - # Debit Note - # fiscal_purchase_debit_note_wizard = ( - # self.env["account.debit.note"] - # .with_context( - # active_ids=ncf_purchase_credito_fiscal_invoice.ids, - # active_model="account.move", - # ) - # .create( - # { - # "l10n_do_debit_type": "percentage", - # "l10n_do_percentage": "5", - # "l10n_latam_document_number": "B0300000001", - # } - # ) - # ) - # debit_move_id = self.env["account.move"].browse( - # fiscal_purchase_debit_note_wizard.create_debit()["res_id"] - # ) - # self.assertTrue(debit_move_id.l10n_latam_manual_document_number) - # self.assertEqual( - # debit_move_id.l10n_latam_available_document_type_ids, - # self.env["l10n_latam.document.type"].browse( - # ( - # self.do_document_type["debit_note"] - # + self.do_document_type["e-debit_note"] - # ).ids - # ), - # "Tax Payer invoice must have Nota de Debito as available document type", - # ) + fiscal_purchase_debit_note_wizard = ( + self.env["account.debit.note"] + .with_context( + active_ids=ncf_purchase_credito_fiscal_invoice.ids, + active_model="account.move", + ) + .create( + { + "l10n_do_debit_type": "percentage", + "l10n_do_percentage": "5", + "l10n_latam_document_number": "B0300000001", + } + ) + ) + debit_move_id = self.env["account.move"].browse( + fiscal_purchase_debit_note_wizard.create_debit()["res_id"] + ) + self.assertTrue(debit_move_id.l10n_latam_manual_document_number) + self.assertEqual( + debit_move_id.l10n_latam_available_document_type_ids, + self.env["l10n_latam.document.type"].browse( + ( + self.do_document_type["debit_note"] + + self.do_document_type["e-debit_note"] + ).ids + ), + "Tax Payer invoice must have Nota de Debito as available document type", + ) ncf_purchase_compra_invoice = self._create_l10n_do_invoice( data={ @@ -287,7 +284,7 @@ def test_002_invoice_ecf_types(self): ) # Credit Note - ecf_sale_credito_fiscal_invoice._post() + ecf_sale_credito_fiscal_invoice.with_context(testing=True)._post() fiscal_sale_credit_note_wizard = ( self.env["account.move.reversal"] .with_context( @@ -296,8 +293,8 @@ def test_002_invoice_ecf_types(self): ) .create( { - "refund_type": "percentage", - "percentage": "5", + "l10n_do_refund_type": "percentage", + "l10n_do_percentage": "5", "journal_id": ecf_sale_credito_fiscal_invoice[0].journal_id.id, } ) @@ -412,6 +409,7 @@ def test_002_invoice_ecf_types(self): "document_number": "E310000000001", "expense_type": "02", "document_type": self.do_document_type["e-fiscal"], + "invoice_date": fields.Date.today(), }, invoice_type="in_invoice", ) @@ -430,7 +428,7 @@ def test_002_invoice_ecf_types(self): ) # Credit Note - ecf_purchase_credito_fiscal_invoice._post() + ecf_purchase_credito_fiscal_invoice.with_context(testing=True)._post() fiscal_purchase_credit_note_wizard = ( self.env["account.move.reversal"] .with_context( @@ -439,8 +437,8 @@ def test_002_invoice_ecf_types(self): ) .create( { - "refund_type": "percentage", - "percentage": "5", + "l10n_do_refund_type": "percentage", + "l10n_do_percentage": "5", "l10n_latam_document_number": "B0400000001", "journal_id": ecf_purchase_credito_fiscal_invoice[0].journal_id.id, } @@ -462,40 +460,36 @@ def test_002_invoice_ecf_types(self): "Electronica as available document type", ) - # TODO: revisar estos test. - # Está provocando error en - # odoo//addons/l10n_latam_invoice_document/models/account_move.py#L224 - # Debit Note - # fiscal_purchase_debit_note_wizard = ( - # self.env["account.debit.note"] - # .with_context( - # active_ids=ecf_purchase_credito_fiscal_invoice.ids, - # active_model="account.move", - # ) - # .create( - # { - # "l10n_do_debit_type": "percentage", - # "l10n_do_percentage": "5", - # "l10n_latam_document_number": "B0300000001", - # } - # ) - # ) - # debit_move_id = self.env["account.move"].browse( - # fiscal_purchase_debit_note_wizard.create_debit()["res_id"] - # ) - # self.assertTrue(debit_move_id.l10n_latam_manual_document_number) - # self.assertEqual( - # debit_move_id.l10n_latam_available_document_type_ids, - # self.env["l10n_latam.document.type"].browse( - # ( - # self.do_document_type["debit_note"] - # + self.do_document_type["e-debit_note"] - # ).ids - # ), - # "Tax Payer invoice must have Nota de Debito and Nota de Debito " - # "Electronica as available document type", - # ) + fiscal_purchase_debit_note_wizard = ( + self.env["account.debit.note"] + .with_context( + active_ids=ecf_purchase_credito_fiscal_invoice.ids, + active_model="account.move", + ) + .create( + { + "l10n_do_debit_type": "percentage", + "l10n_do_percentage": "5", + "l10n_latam_document_number": "B0300000001", + } + ) + ) + debit_move_id = self.env["account.move"].browse( + fiscal_purchase_debit_note_wizard.create_debit()["res_id"] + ) + self.assertTrue(debit_move_id.l10n_latam_manual_document_number) + self.assertEqual( + debit_move_id.l10n_latam_available_document_type_ids, + self.env["l10n_latam.document.type"].browse( + ( + self.do_document_type["debit_note"] + + self.do_document_type["e-debit_note"] + ).ids + ), + "Tax Payer invoice must have Nota de Debito and Nota de Debito " + "Electronica as available document type", + ) ecf_purchase_compra_invoice = self._create_l10n_do_invoice( data={ @@ -540,6 +534,7 @@ def test_003_enable_first_sequence(self): "partner": self.consumo_partner, "document_number": "B1100000001", "expense_type": "02", + "invoice_date": fields.Date.today(), }, invoice_type="in_invoice", ) @@ -582,7 +577,7 @@ def test_005_company_in_contingency(self): "document_number": "E310000000001", } ) - sale_invoice_1_id._post() + sale_invoice_1_id.with_context(testing=True)._post() self.do_company.l10n_do_ecf_issuer = False @@ -598,10 +593,10 @@ def test_006_invoice_electronic_stamp(self): Check invoice electronic stamp feature works properly """ stamp = ( - "https%3A%2F%2Fecf.dgii.gov.do%2FCerteCF%2FConsultaTimbre%3FRncEmisor" + "https%3A%2F%2Fecf.dgii.gov.do%2FTesteCF%2FConsultaTimbre%3FRncEmisor" "%3D131793916%26RncComprador%3D131566332%26ENCF%3DE310000000001%26Fec" - "haEmision%3D16-10-2021%26MontoTotal%3D118%26FechaFirma%3D16-10-2021%" - "252000%3A00%3A00%26CodigoSeguridad%3Du83ac1" + "haEmision%3D16-10-2021%26MontoTotal%3D118%26FechaFirma%3D16-10-2021+" + "00%3A00%3A00%26CodigoSeguridad%3Du83ac1" ) sign_date = "2021-10-16" @@ -618,8 +613,8 @@ def test_006_invoice_electronic_stamp(self): "l10n_do_ecf_sign_date": sign_date, } ) + sale_invoice_1_id.with_context(testing=True)._post() self.assertEqual(sale_invoice_1_id.l10n_do_electronic_stamp, stamp) - sale_invoice_1_id._post() def test_007_unique_sequence_number(self): """ @@ -634,11 +629,7 @@ def test_007_unique_sequence_number(self): ) invoice_id._post() - invoice_2 = self._create_l10n_do_invoice( - data={ - "document_number": "B0100000002", - } - ) + invoice_2 = self._create_l10n_do_invoice() invoice_2._post() with self.assertRaises(ValidationError): invoice_2.write({"l10n_do_fiscal_number": "B0100000001"}) @@ -670,6 +661,7 @@ def test_008_check_sequence(self): data={ "document_number": "B0100000001", "expense_type": "02", + "invoice_date": fields.Date.today(), }, invoice_type="in_invoice", ) @@ -684,6 +676,7 @@ def test_008_check_sequence(self): "partner": self.consumo_partner, "document_number": "B1100000001", "expense_type": "02", + "invoice_date": fields.Date.today(), }, invoice_type="in_invoice", ) diff --git a/l10n_do_accounting/views/account_move_views.xml b/l10n_do_accounting/views/account_move_views.xml index ac0fbbe1d..7d7ff63d5 100644 --- a/l10n_do_accounting/views/account_move_views.xml +++ b/l10n_do_accounting/views/account_move_views.xml @@ -88,7 +88,7 @@ - + diff --git a/l10n_do_accounting/views/report_invoice.xml b/l10n_do_accounting/views/report_invoice.xml index e7c9fe281..82ce55202 100644 --- a/l10n_do_accounting/views/report_invoice.xml +++ b/l10n_do_accounting/views/report_invoice.xml @@ -12,7 +12,6 @@
- @@ -184,8 +183,8 @@ - - + + Monto Gravado @@ -212,8 +211,7 @@ Total - + diff --git a/l10n_do_accounting/views/report_templates.xml b/l10n_do_accounting/views/report_templates.xml index f552321f5..85d1b3c45 100644 --- a/l10n_do_accounting/views/report_templates.xml +++ b/l10n_do_accounting/views/report_templates.xml @@ -8,23 +8,22 @@
- - - + - - +