Skip to content
Snippets Groups Projects
Commit 15543ebb authored by Katherine Zaoral's avatar Katherine Zaoral
Browse files

[FIX] l10n_ar_account: proper compare document numbers in vendor bills


When creating vendor bills, it was considering this two numbers as different but actually are the same invoice number

* 01234-00000001
+ 1234-00000001

To avoid this we remove the zero to the left always if the pos number > 4.

closes odoo/odoo#41196

Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
parent 5e6ca530
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,8 @@ class L10nLatamDocumentType(models.Model):
failed = True
elif len(number) > 8 or not number.isdigit():
failed = True
if len(pos) == 5 and pos[0] == '0':
pos = pos[1:]
document_number = '{:>04s}-{:>08s}'.format(pos, number)
if failed:
raise UserError(msg % (document_number, self.name, _(
......
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