Skip to content

Commit

Permalink
git pull request 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcape14 committed Mar 24, 2024
1 parent 4ff8018 commit 70b4b8b
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/l10n-dominicana.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion l10n_do_accounting/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
130 changes: 130 additions & 0 deletions l10n_do_accounting/i18n/es_DO.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion l10n_do_accounting/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
61 changes: 53 additions & 8 deletions l10n_do_accounting/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
)
Expand Down
Loading

0 comments on commit 70b4b8b

Please sign in to comment.