Skip to content
Snippets Groups Projects
Commit 58732e4d authored by Juan Jose Scarafia's avatar Juan Jose Scarafia
Browse files

[FIX] l10n_latam_invoice_document: bill unlink


closes odoo/odoo#44415

X-original-commit: fd8af797
Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
parent 1c14419e
No related branches found
No related tags found
No related merge requests found
......@@ -214,3 +214,9 @@ class AccountMove(models.Model):
]
if rec.search(domain):
raise ValidationError(_('Vendor bill number must be unique per vendor and company.'))
def unlink(self):
""" When using documents, on vendor bills the document_number is set manually by the number given from the vendor,
the odoo sequence is not used. In this case We allow to delete vendor bills with document_number/move_name """
self.filtered(lambda x: x.type in x.get_purchase_types() and x.state in ('draft', 'cancel') and x.l10n_latam_use_documents).write({'name': '/'})
return super().unlink()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment