Skip to content

Conversation

@NB5055
Copy link
Contributor

@NB5055 NB5055 commented Oct 15, 2017

Correccion de validacion NCF compras

Correccion de validacion NCF compras
@gustavovalverde gustavovalverde self-assigned this Oct 15, 2017
Copy link
Collaborator

@gustavovalverde gustavovalverde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verificar los comentarios, tambuén validar si tal vez sería más conveniente hacer una condición como esta:

                res = self.env["marcos.api.tools"].invoice_ncf_validation(rec)
                if res is not True:
                    raise exceptions.ValidationError(res[2])

elif rec.type in (
"in_invoice", "in_refund") and rec.journal_id.purchase_type == "normal" and rec.partner_id.vat:
ncf_validation_result = self.env["marcos.api.tools"].invoice_ncf_validation(self)
if ncf_validation_result != True:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mejorar sintaxis de la condición pythonif ncf_validation_result is not True

msg = u"El proveedor no tiene RNC y es requerido para este tipo de compra."

elif rec.type in (
"in_invoice", "in_refund") and rec.journal_id.purchase_type == "normal" and rec.partner_id.vat:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No solo son los normales, también los informales

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants