Skip to content

Commit

Permalink
[MIG] sequence_check_digit: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaynnan committed Jul 18, 2023
1 parent 53fd392 commit 073c4f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# generated from manifests external_dependencies
pdf2image
python-stdnum
pyzbar
3 changes: 1 addition & 2 deletions sequence_check_digit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Check Digit on Sequences",
"version": "14.0.1.0.2",
"version": "15.0.1.0.0",
"category": "Reporting",
"website": "https://github.com/OCA/server-ux",
"author": "Creu Blanca, Odoo Community Association (OCA)",
Expand All @@ -13,5 +13,4 @@
"summary": "Adds a check digit on sequences",
"depends": ["base"],
"data": ["views/sequence_views.xml"],
"external_dependencies": {"python": ["python-stdnum"]},
}
8 changes: 4 additions & 4 deletions sequence_check_digit/models/ir_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ def check_check_digit_formula(self):
try:
self.get_next_char(0)
except Exception:
raise ValidationError(_("Format is not accepted"))
raise ValidationError(_("Format is not accepted")) from None

def get_check_digit(self, code):
try:
return self.get_formula_map()[self.check_digit_formula](code)
except KeyError:
raise ValidationError(

Check warning on line 46 in sequence_check_digit/models/ir_sequence.py

View check run for this annotation

Codecov / codecov/patch

sequence_check_digit/models/ir_sequence.py#L46

Added line #L46 was not covered by tests
_("%s is not an implemented function" % self.check_digit_formula)
)
_("%s is not an implemented function") % self.check_digit_formula
) from None
except Exception:
raise ValidationError(_("Format is not accepted"))
raise ValidationError(_("Format is not accepted")) from None

def get_formula_map(self):
return {
Expand Down

0 comments on commit 073c4f1

Please sign in to comment.