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
| - itemAssetToolingId | Integer | To change one; None adds one |
| - itemId | Integer | Required |
| - assetId | Integer | The machine; None for any machine |
| - toolingAssetId | Integer | A specific tool, or |
| - toolingAssetTypeId | Integer | any tool of this tooling type |
| - required | Boolean | False lists a tool the item may use, without a warning when it isn't mounted. Default True |
| - sortOrder | Integer | |
| - enabled | Boolean | Default 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)