From 70b4b8b620ef482bb1f8ad936a26520418d93462 Mon Sep 17 00:00:00 2001 From: Alejandro Capellan Date: Sat, 23 Mar 2024 22:21:00 -0400 Subject: [PATCH] git pull request 15.0 --- .idea/.gitignore | 3 + .idea/inspectionProfiles/Project_Default.xml | 12 ++ .../inspectionProfiles/profiles_settings.xml | 6 + .idea/l10n-dominicana.iml | 12 ++ .idea/misc.xml | 4 + .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/i18n/es_DO.po | 130 ++++++++++++++++++ l10n_do_accounting/models/account_journal.py | 5 +- l10n_do_accounting/models/account_move.py | 61 ++++++-- .../views/account_move_views.xml | 10 ++ .../wizard/account_move_reversal.py | 50 +------ 13 files changed, 254 insertions(+), 55 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/l10n-dominicana.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..8b88b463f --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..105ce2da2 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/l10n-dominicana.iml b/.idea/l10n-dominicana.iml new file mode 100644 index 000000000..8b8c39547 --- /dev/null +++ b/.idea/l10n-dominicana.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..d1e22ecb8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..66c20e512 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 6748de2a7..0190e4aa4 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": "15.0.0.12.4", + "version": "15.0.0.14.2", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/i18n/es_DO.po b/l10n_do_accounting/i18n/es_DO.po index ad9f4f940..bd65de8dd 100644 --- a/l10n_do_accounting/i18n/es_DO.po +++ b/l10n_do_accounting/i18n/es_DO.po @@ -7,6 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0+e\n" "Report-Msgid-Bugs-To: \n" +<<<<<<< HEAD "POT-Creation-Date: 2024-01-10 05:00+0000\n" "PO-Revision-Date: 2024-01-10 05:00+0000\n" "Last-Translator: \n" @@ -15,6 +16,18 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +======= +"POT-Creation-Date: 2024-02-06 14:49+0000\n" +"PO-Revision-Date: 2024-02-06 10:53-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: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4.2\n" +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.informations @@ -261,6 +274,11 @@ msgstr "Compañías" msgid "Company" msgstr "Compañía" +#. 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 @@ -271,6 +289,7 @@ msgstr "Empresa 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" +<<<<<<< HEAD msgstr "Empresa relacionada con esta revista" #. module: l10n_do_accounting_plus @@ -280,6 +299,12 @@ msgstr "Opciones de configuración" #. module: l10n_do_accounting_plus #: model:ir.model,name:l10n_do_accounting_plus.model_res_partner +======= +msgstr "Empresa relacionada con este diario" + +#. module: l10n_do_accounting +#: model:ir.model,name:l10n_do_accounting.model_res_partner +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea msgid "Contact" msgstr "Contacto" @@ -768,12 +793,48 @@ msgstr "" #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.view_move_form msgid "" +<<<<<<< HEAD "Notice. This company is in a transient state of contingency for Electronic " "Invoice issuing. NCF issuing has been enabled." +======= +"Notice. Document Number field enabled because a new Fiscal Number Expiration date was " +"set on journal" msgstr "" +"Aviso. Se ha activado el campo Número de Comprobante porque se ha establecido una nueva " +"fecha de expiración del NCF en el diario" +#. module: l10n_do_accounting +#: model_terms:ir.ui.view,arch_db:l10n_do_accounting.view_move_form +msgid "" +"Notice. This company is in a transient state of contingency for Electronic Invoice " +"issuing. NCF issuing has been enabled." +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea +msgstr "" + +<<<<<<< HEAD #. modules: l10n_do_accounting_plus, l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_bank_statement_import_journal_creation__l10n_do_payment_form +======= +#. module: l10n_do_accounting +#: 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 +#: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 +#, python-format +msgid "Partial Refund" +msgstr "Reembolso Parcial" + +#. module: l10n_do_accounting +#: code:addons/l10n_do_accounting/models/account_journal.py:0 +#, python-format +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 +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_journal__l10n_do_payment_form #: model:ir.model.fields,field_description:l10n_do_accounting_plus.field_account_payment_method_line__l10n_do_payment_form msgid "Payment Form" @@ -856,6 +917,13 @@ msgstr "" msgid "Show name in report label right" msgstr "" +#. module: l10n_do_accounting +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_bank_statement_line__l10n_do_show_expiration_date_msg +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_move__l10n_do_show_expiration_date_msg +#: model:ir.model.fields,field_description:l10n_do_accounting.field_account_payment__l10n_do_show_expiration_date_msg +msgid "Show Expiration Date Message" +msgstr "Mostrar Mensaje Fecha Expiración" + #. module: l10n_do_accounting #: model:ir.model.fields,help:l10n_do_accounting.field_account_bank_statement_line__l10n_do_fiscal_number #: model:ir.model.fields,help:l10n_do_accounting.field_account_move__l10n_do_fiscal_number @@ -893,6 +961,18 @@ msgid "" "enabled to be set manually." msgstr "" +#. module: l10n_do_accounting +#: model:ir.model.fields,help:l10n_do_accounting.field_account_bank_statement_line__l10n_do_show_expiration_date_msg +#: model:ir.model.fields,help:l10n_do_accounting.field_account_move__l10n_do_show_expiration_date_msg +#: model:ir.model.fields,help:l10n_do_accounting.field_account_payment__l10n_do_show_expiration_date_msg +msgid "" +"Technical field to hide/show message on invoice header that indicate fiscal number must " +"be input manually because a new expiration date was set on journal" +msgstr "" +"Campo técnico para ocultar/mostrar un mensaje en el encabezado de las facturas para " +"indicar que el NCF debe ser digital manualmente porque se colocó una nueva fecha de " +"expiración en el diario" + #. module: l10n_do_accounting #: model:ir.model.fields,help:l10n_do_accounting.field_account_debit_note__l10n_latam_country_code #: model:ir.model.fields,help:l10n_do_accounting.field_account_move_reversal__country_code @@ -916,7 +996,11 @@ msgstr "" #. module: l10n_do_accounting #: model:ir.model.fields,field_description:l10n_do_accounting.field_account_debit_note__l10n_latam_use_documents msgid "Use Documents" +<<<<<<< HEAD msgstr "" +======= +msgstr "Es fiscal" +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.view_account_move_reversal_inherited @@ -972,6 +1056,52 @@ msgstr "" #: model:ir.model.fields,help:l10n_do_accounting.field_res_company__l10n_do_ecf_issuer msgid "When activating this field, NCF issuance is disabled." msgstr "" +<<<<<<< HEAD +======= +"No tiene permiso de modificar los campos %s luego de la emisión de un documento fiscal " +"de este contacto" + +#. module: l10n_do_accounting +#: code:addons/l10n_do_accounting/wizard/account_move_reversal.py:0 +#, python-format +msgid "" +"You can only reverse documents with legal invoicing documents from Latin America one at " +"a time.\n" +"Problematic documents: %s" +msgstr "" +"Solo puede aplicar Notas de Crédito a una factura a la vez.\n" +"Documentos señalados: %s" + +#. module: l10n_do_accounting +#: 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 +#: 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 +#: 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 +#: 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 +#: code:addons/l10n_do_accounting/wizard/account_debit_note.py:0 +#, python-format +msgid "You cannot issue Credit/Debit Notes for %s document type" +msgstr "No puede emitir Notas de Crédito/Débito para comprobantes de %s" +>>>>>>> c3a74e2bcbf76ea6262712137f6b8ef57cae6bea #. module: l10n_do_accounting #: model_terms:ir.ui.view,arch_db:l10n_do_accounting.view_account_debit_note_inherited diff --git a/l10n_do_accounting/models/account_journal.py b/l10n_do_accounting/models/account_journal.py index aad92185c..c93baad70 100644 --- a/l10n_do_accounting/models/account_journal.py +++ b/l10n_do_accounting/models/account_journal.py @@ -216,7 +216,10 @@ class AccountJournalDocumentType(models.Model): l10n_do_ncf_expiration_date = fields.Date( string="Expiration date", required=True, - default=fields.Date.end_of(fields.Date.today(), "year"), + default=fields.Date.end_of( + fields.Date.today().replace(month=12, year=fields.Date.today().year + 1), + "year", + ), ) company_id = fields.Many2one( string="Company", related="journal_id.company_id", readonly=True diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 5469ccd79..45d35b44f 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -118,6 +118,12 @@ def _get_l10n_do_income_type(self): "ECF XML File Name", copy=False, readonly=True ) l10n_latam_manual_document_number = fields.Boolean(store=True) + l10n_do_show_expiration_date_msg = fields.Boolean( + "Show Expiration Date Message", + compute="_compute_l10n_do_show_expiration_date_msg", + help="Technical field to hide/show message on invoice header that indicate fiscal number must be input " + "manually because a new expiration date was set on journal", + ) def init(self): super(AccountMove, self).init() @@ -166,6 +172,45 @@ def _name_search( expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid ) + def _l10n_do_is_new_expiration_date(self): + self.ensure_one() + last_invoice = self.search( + [ + ("company_id", "=", self.company_id.id), + ("move_type", "=", self.move_type), + ( + "l10n_latam_document_type_id", + "=", + self.l10n_latam_document_type_id.id, + ), + ("posted_before", "=", True), + ("id", "!=", self.id or self._origin.id), + ("l10n_do_ncf_expiration_date", "!=", False), + ], + order="invoice_date desc, id desc", + limit=1, + ) + if not last_invoice: + return False + + return ( + last_invoice.l10n_do_ncf_expiration_date < self.l10n_do_ncf_expiration_date + ) + + @api.depends("l10n_do_ncf_expiration_date", "journal_id") + def _compute_l10n_do_show_expiration_date_msg(self): + l10n_do_internal_invoices = self.filtered( + lambda inv: inv.l10n_latam_use_documents + and inv.l10n_latam_document_type_id + and inv.country_code == "DO" + and not inv.l10n_latam_manual_document_number + and inv.l10n_do_ncf_expiration_date + ) + for invoice in l10n_do_internal_invoices: + invoice.l10n_do_show_expiration_date_msg = invoice._l10n_do_is_new_expiration_date() + + (self - l10n_do_internal_invoices).l10n_do_show_expiration_date_msg = False + @api.depends( "journal_id.l10n_latam_use_documents", "l10n_latam_manual_document_number", @@ -198,7 +243,7 @@ def _compute_l10n_do_enable_first_sequence(self): ("id", "!=", invoice.id or invoice._origin.id), ], ) - ) + ) or invoice.l10n_do_show_expiration_date_msg (self - l10n_do_internal_invoices).l10n_do_enable_first_sequence = False @@ -675,6 +720,13 @@ def _compute_l10n_latam_manual_document_number(self): move._is_l10n_do_manual_document_number() ) + move.l10n_do_ncf_expiration_date = ( + move.journal_id.l10n_do_document_type_ids.filtered( + lambda doc: doc.l10n_latam_document_type_id + == move.l10n_latam_document_type_id + ).l10n_do_ncf_expiration_date + ) + super( AccountMove, self - l10n_do_recs_with_journal_id )._compute_l10n_latam_manual_document_number() @@ -771,13 +823,6 @@ def _post(self, soft=True): if not invoice.amount_total: raise UserError(_("Fiscal invoice cannot be posted with amount zero.")) - invoice.l10n_do_ncf_expiration_date = ( - invoice.journal_id.l10n_do_document_type_ids.filtered( - lambda doc: doc.l10n_latam_document_type_id - == invoice.l10n_latam_document_type_id - ).l10n_do_ncf_expiration_date - ) - non_payer_type_invoices = l10n_do_invoices.filtered( lambda inv: not inv.partner_id.l10n_do_dgii_tax_payer_type ) diff --git a/l10n_do_accounting/views/account_move_views.xml b/l10n_do_accounting/views/account_move_views.xml index 107ba09c2..53f98c608 100644 --- a/l10n_do_accounting/views/account_move_views.xml +++ b/l10n_do_accounting/views/account_move_views.xml @@ -9,6 +9,7 @@ +
Notice. This company is in a transient state of contingency for Electronic Invoice issuing. NCF issuing has been enabled.
+