Skip to content
Permalink
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.
  • Loading branch information
zaoral committed Dec 2, 2019
1 parent 3abe39e commit 3eb96edc736ee9d0424fddbf7075b2739b7962d2
Showing with 2 additions and 0 deletions.
  1. +2 −0 addons/l10n_ar/models/l10n_latam_document_type.py
@@ -85,6 +85,8 @@ def _format_document_number(self, document_number):
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 comments on commit 3eb96ed

Please sign in to comment.
You can’t perform that action at this time.