Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCF compras #45

Open
wants to merge 2 commits into
base: 10.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ncf_manager/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ def action_invoice_open(self):
elif rec.type in (
"in_invoice", "in_refund") and rec.journal_id.purchase_type == "normal" and not rec.partner_id.vat:
msg = u"El proveedor no tiene RNC y es requerido para este tipo de compra."

res = self.env["marcos.api.tools"].invoice_ncf_validation(rec)
if res is not True and rec.journal_id.purchase_type in ('normal', 'minor', 'informal'):
raise exceptions.ValidationError(res[2])

if msg:
raise exceptions.ValidationError(msg)
Expand Down