mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-19 13:18:03 +00:00
Enhance plugin SN validation (#7942)
* Update function signature for 'validate_serial_number' - Pass through stock item parameter - Required if we want to exclude a particular item from that test * Update documentation * Docs fixes * Add type annotations
This commit is contained in:
@@ -121,7 +121,7 @@ class SampleValidatorPlugin(SettingsMixin, ValidationMixin, InvenTreePlugin):
|
||||
if d >= 100:
|
||||
self.raise_error('Value must be less than 100')
|
||||
|
||||
def validate_serial_number(self, serial: str, part):
|
||||
def validate_serial_number(self, serial: str, part, stock_item=None):
|
||||
"""Validate serial number for a given StockItem.
|
||||
|
||||
These examples are silly, but serve to demonstrate how the feature could be used
|
||||
|
||||
Reference in New Issue
Block a user