2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Handle 'next serial' more gracefully

This commit is contained in:
Ben Charlton
2020-08-21 19:17:58 +01:00
parent c31b30bf83
commit 23cc3d9b06
2 changed files with 6 additions and 3 deletions

View File

@ -391,8 +391,8 @@ class VariantTest(StockTest):
with self.assertRaises(ValidationError):
item.save()
# This should pass
item.serial = n + 1
# This should pass, although not strictly an int field now.
item.serial = int(n) + 1
item.save()
# Attempt to create the same serial number but for a variant (should fail!)