Skip to content
Snippets Groups Projects
Commit 78ecfd66 authored by paso-odoo's avatar paso-odoo
Browse files

[FIX] l10n_id_efaktur: fix the issue of invalid literal base10 in efaktur

If applied, this commit will solve the min-max issues for efaktur.

- invalid literal for int() with base 10: when we enter all characters
string in the min or max it will raise an error like this.

- Error is also raised when the min or max is blank and try to save the
record.

So, I have update the value as 0 if the min value or max value not
generated.

see - https://tinyurl.com/2lx9j2kr



Sentry - 3936020226

closes odoo/odoo#112850

Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 1d6ae6bb
No related branches found
No related tags found
No related merge requests found
......@@ -98,12 +98,14 @@ class Efaktur(models.Model):
@api.onchange('min')
def _onchange_min(self):
self.min = '%013d' % int(re.sub(r'\D', '', self.min))
min_val = re.sub(r'\D', '', str(self.min)) or 0
self.min = '%013d' % int(min_val)
if not self.max or int(self.min) > int(self.max):
self.max = self.min
@api.onchange('max')
def _onchange_max(self):
self.max = '%013d' % int(re.sub(r'\D', '', self.max))
max_val = re.sub(r'\D', '', str(self.max)) or 0
self.max = '%013d' % int(max_val)
if not self.min or int(self.min) > int(self.max):
self.min = self.max
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