mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 13:35:40 +00:00
* 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
191 lines
3.2 KiB
YAML
191 lines
3.2 KiB
YAML
# Create some fasteners
|
|
|
|
- model: part.part
|
|
pk: 1
|
|
fields:
|
|
name: 'M2x4 LPHS'
|
|
description: 'M2x4 low profile head screw'
|
|
category: 8
|
|
link: http://www.acme.com/parts/m2x4lphs
|
|
tree_id: 0
|
|
purchaseable: True
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 2
|
|
fields:
|
|
name: 'M3x12 SHCS'
|
|
description: 'M3x12 socket head cap screw'
|
|
category: 8
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
# Create some resistors
|
|
|
|
- model: part.part
|
|
pk: 3
|
|
fields:
|
|
name: 'R_2K2_0805'
|
|
description: '2.2kOhm resistor in 0805 package'
|
|
category: 2
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
|
|
- model: part.part
|
|
pk: 4
|
|
fields:
|
|
name: 'R_4K7_0603'
|
|
description: '4.7kOhm resistor in 0603 package'
|
|
category: 2
|
|
default_location: 2 # Home/Bathroom
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
# Create some capacitors
|
|
- model: part.part
|
|
pk: 5
|
|
fields:
|
|
name: 'C_22N_0805'
|
|
description: '22nF capacitor in 0805 package'
|
|
purchaseable: true
|
|
category: 3
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 25
|
|
fields:
|
|
name: 'Widget'
|
|
description: 'A watchamacallit'
|
|
category: 7
|
|
salable: true
|
|
assembly: true
|
|
trackable: true
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
default_expiry: 10
|
|
|
|
- model: part.part
|
|
pk: 50
|
|
fields:
|
|
name: 'Orphan'
|
|
description: 'A part without a category'
|
|
category: null
|
|
salable: true
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
# A part that can be made from other parts
|
|
- model: part.part
|
|
pk: 100
|
|
fields:
|
|
name: 'Bob'
|
|
description: 'Can we build it? Yes we can!'
|
|
assembly: true
|
|
salable: true
|
|
purchaseable: false
|
|
category: 7
|
|
active: False
|
|
IPN: BOB
|
|
revision: A2
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 101
|
|
fields:
|
|
name: 'Assembly'
|
|
description: 'A high level assembly part'
|
|
salable: true
|
|
active: True
|
|
tree_id: 0
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
# A 'template' part
|
|
- model: part.part
|
|
pk: 10000
|
|
fields:
|
|
name: 'Chair Template'
|
|
description: 'A chair, which is actually just a template part'
|
|
is_template: True
|
|
trackable: true
|
|
salable: true
|
|
category: 7
|
|
tree_id: 1
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 10001
|
|
fields:
|
|
name: 'Blue Chair'
|
|
description: 'A variant chair part which is blue'
|
|
variant_of: 10000
|
|
trackable: true
|
|
category: 7
|
|
tree_id: 1
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 10002
|
|
fields:
|
|
name: 'Red chair'
|
|
description: 'A variant chair part which is red'
|
|
variant_of: 10000
|
|
IPN: "R.CH"
|
|
trackable: true
|
|
category: 7
|
|
tree_id: 1
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 10003
|
|
fields:
|
|
name: 'Green chair'
|
|
description: 'A template chair part which is green'
|
|
variant_of: 10000
|
|
category: 7
|
|
trackable: true
|
|
tree_id: 1
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|
|
|
|
- model: part.part
|
|
pk: 10004
|
|
fields:
|
|
name: 'Green chair variant'
|
|
description: 'A green chair, which is a variant of the chair template'
|
|
variant_of: 10003
|
|
is_template: true
|
|
category: 7
|
|
trackable: true
|
|
tree_id: 1
|
|
level: 0
|
|
lft: 0
|
|
rght: 0
|