Skip to content

Commit

Permalink
Check ABV when creating a new stock type
Browse files Browse the repository at this point in the history
Absence of this check enabled new stock types to be created with ABVs
that were invalid according to the rules for the stock type's
department.
  • Loading branch information
sde1000 committed Apr 13, 2023
1 parent 15cb6f3 commit e0e3e77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions quicktill/stocktype.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def finish_select(self):
# Confirmation box time...
if st is None:
if self.allownew:
# Re-check, including checking the ABV this time
problem = self.validate_fields()
if problem:
ui.infopopup([problem], title="Error")
return
ui.infopopup(
["There's no existing stock type that matches the "
"details you've entered. Press Cash/Enter to "
Expand Down

0 comments on commit e0e3e77

Please sign in to comment.