Skip to main content

system.kanoa.tooling.saveRequiredTooling(toolingInfo, userId)

Adds a tool an item needs on a machine, or changes one (with itemAssetToolingId). Give a tool or a tooling type, not both; the machine, if given, must use tooling. The same tool can't be required twice for the same item and machine. The operations still to come that make the item reserve their tools again to match.


Parameters​

toolingInfo Dictionary

- itemAssetToolingIdIntegerTo change one; None adds one
- itemIdIntegerRequired
- assetIdIntegerThe machine; None for any machine
- toolingAssetIdIntegerA specific tool, or
- toolingAssetTypeIdIntegerany tool of this tooling type
- requiredBooleanFalse lists a tool the item may use, without a warning when it isn't mounted. Default True
- sortOrderInteger
- enabledBooleanDefault True

userId Integer: The user making the change


Returns​

(itemAssetToolingId, message): the requirement's id and None, or None and why it was refused


Example​

toolingInfo = {'itemId': 1, 'assetId': 1, 'toolingAssetId': 1, 'required': True}
userId = 5
itemAssetToolingId, message = system.kanoa.tooling.saveRequiredTooling(toolingInfo, userId)