Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
To use endpoint /api/build/$buildId/complete/ we need to provide output ids.
But there is no way from docs to obtain output ids some how.
It should be returned when we create it with endpoint /api/build/$buildId/create-output/
Steps to Reproduce
- Create build with POST to
/api/build/ - Then create build output with POST to '/api/build/$buildId/create-output/'
- Then try to complete the build with POST to
/api/build/$buildId/complete/
Expected behaviour
From step 2 we should obtain output id which later we can use in completing build request /api/build/$buildId/complete/ which required output id.
Deployment Method
- Docker
- Package
- Bare metal
- Other - added info in Steps to Reproduce
Version Information
Version Information:
InvenTree-Version: 0.16.3
Django Version: 4.2.15
Commit Hash: b0b05e4
Commit Date: 2024-09-21
Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.8.0-1019-aws-x86_64-with
Installer: DOC
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]
Please verify if you can reproduce this bug on the demo site.
- I can reproduce this bug on the demo site.
Relevant log output
[23-Nov-2024 03:48:03 UTC] trying to create buildArray
(
[reference] => BO-4850
[part] => 62
[quantity] => 1
[sales_order] => 761
[create_child_builds] => 1
[take_from] => 1
[destination] => 1
[priority] => 0
[target_date] => 2024-11-23
)
[23-Nov-2024 03:48:04 UTC] ## create build response: 201 - stdClass Object
(
[pk] => 134
[url] => /build/134/
[title] =>
[barcode_hash] =>
[batch] =>
[creation_date] => 2024-11-23
[completed] => 0
[completion_date] =>
[destination] => 1
[parent] =>
[part] => 62
[part_name] => Some name
[project_code] =>
[project_code_detail] =>
[reference] => BO-4850
[sales_order] => 761
[quantity] => 1
[status] => 10
[status_text] => Pending
[target_date] => 2024-11-23
[take_from] => 1
[notes] =>
[link] =>
[issued_by] =>
[issued_by_detail] =>
[responsible] =>
[responsible_detail] =>
[priority] => 0
)
[23-Nov-2024 03:48:04 UTC] -- run api createBuildOutput
[23-Nov-2024 03:48:05 UTC] ## create build output response: 201 - stdClass Object
(
[quantity] => 1.00000
[batch_code] => BO-4850
[location] => 1
[auto_allocate] => 1
)
[23-Nov-2024 03:48:05 UTC] Build output result: stdClass Object
(
[quantity] => 1.00000
[batch_code] => BO-4850
[location] => 1
[auto_allocate] => 1
)
[23-Nov-2024 03:48:05 UTC] -- run api completeBuild
[23-Nov-2024 03:48:05 UTC] ## complete build response: 400 - stdClass Object
(
[outputs] => Array
(
[0] => stdClass Object
(
[output] => Array
(
[0] => Build output does not match the parent build
)
)
)
)
Activity
jack-fdrv commentedon Nov 23, 2024
jack-fdrv commentedon Nov 23, 2024
I was able to find it, but guys... we need to include id in response....
Have an extra api call for each build is not good...
SchrodingersGat commentedon Nov 23, 2024
@jack-fdrv glad you got it worked out. If you feel that the API could be improved, we happily accept PRs 👍
github-actions commentedon Jan 22, 2025
This issue seems stale. Please react to show this is still important.
SchrodingersGat commentedon Jan 22, 2025
@jack-fdrv are you willing to work on this?
github-actions commentedon Mar 24, 2025
This issue seems stale. Please react to show this is still important.
SchrodingersGat commentedon Mar 24, 2025
Not stale