2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-06 12:01:41 +00:00

Extend functionality of custom validation plugins (#4391)

* Pass "Part" instance to plugins when calling validate_serial_number

* Pass part instance through when validating IPN

* Improve custom part name validation

- Pass the Part instance through to the plugins
- Validation is performed at the model instance level
- Updates to sample plugin code

* Pass StockItem through when validating batch code

* Pass Part instance through when calling validate_serial_number

* Bug fix

* Update unit tests

* Unit test fixes

* Fixes for unit tests

* More unit test fixes

* More unit tests

* Furrther unit test fixes

* Simplify custom batch code validation

* Further improvements to unit tests

* Further unit test
This commit is contained in:
Oliver
2023-03-07 22:43:12 +11:00
committed by GitHub
parent edae82caa5
commit abeb85cbb3
22 changed files with 193 additions and 137 deletions

View File

@@ -215,7 +215,7 @@ class PartPricingTests(InvenTreeTestCase):
# Create a part
p = part.models.Part.objects.create(
name='Test part for pricing',
description='hello world',
description='hello world, this is a part description',
)
# Create some stock items