Skip to content

Commit

Permalink
[15.0][FIX] l10n_do_ncf_validation: fix on a field that does not exist (
Browse files Browse the repository at this point in the history
#187)

* [FIX] l10n_do_ncf_validation: fix on a field that does not exist

* [REF] l10n_do_ncf_validation: refact code
  • Loading branch information
daniel-pcg authored Dec 19, 2023
1 parent 3f37e73 commit e793f7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion l10n_do_ncf_validation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dominican NCF Validation",
"version": "15.0.1.0.0",
"version": "15.0.1.0.1",
"summary": "Validate NCF from external service",
"category": "Extra Tools",
"author": "Indexa",
Expand Down
7 changes: 5 additions & 2 deletions l10n_do_ncf_validation/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ def action_post(self):
and inv.l10n_latam_use_documents
and inv.company_id.ncf_validation_target != "none"
)

result = super(AccountMove, self).action_post()

for invoice in l10n_do_fiscal_invoice:
ncf_validation_target = invoice.company_id.ncf_validation_target
if ncf_validation_target != "both":

if (
ncf_validation_target == "internal"
and not invoice.is_l10n_do_internal_sequence
and invoice.l10n_latam_manual_document_number
):
continue
elif (
Expand All @@ -117,4 +120,4 @@ def action_post(self):
)
)

return super(AccountMove, self).action_post()
return result

0 comments on commit e793f7d

Please sign in to comment.