Metadata bugfixes (#4947)

* Fix name of model in Metadata API definition

* Add API endpoint for RO, RO line, RO line extra item

* Update InvenTree/order/api.py

Thanks @matmair - missed that I changed this later on

Co-authored-by: Matthias Mair <code@mjmair.com>

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
miggland 2023-06-01 23:54:55 +02:00 committed by GitHub
parent 60f2f1ea86
commit 936c8ad7fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -1649,6 +1649,7 @@ order_api_urls = [
re_path(r'complete/', ReturnOrderComplete.as_view(), name='api-return-order-complete'),
re_path(r'issue/', ReturnOrderIssue.as_view(), name='api-return-order-issue'),
re_path(r'receive/', ReturnOrderReceive.as_view(), name='api-return-order-receive'),
re_path(r'metadata/', MetadataView.as_view(), {'model': models.ReturnOrder}, name='api-return-order-metadata'),
re_path(r'.*$', ReturnOrderDetail.as_view(), name='api-return-order-detail'),
])),
@ -1659,9 +1660,12 @@ order_api_urls = [
re_path(r'^.*$', ReturnOrderList.as_view(), name='api-return-order-list'),
])),
# API endpoints for reutrn order lines
# API endpoints for return order lines
re_path(r'^ro-line/', include([
path('<int:pk>/', ReturnOrderLineItemDetail.as_view(), name='api-return-order-line-detail'),
path('<int:pk>/', include([
re_path(r'^metadata/', MetadataView.as_view(), {'model': models.ReturnOrderLineItem}, name='api-return-order-line-metadata'),
re_path(r'^.*$', ReturnOrderLineItemDetail.as_view(), name='api-return-order-line-detail'),
])),
# Return order line item status code information
re_path(r'status/', StatusView.as_view(), {StatusView.MODEL_REF: ReturnOrderLineStatus}, name='api-return-order-line-status-codes'),
@ -1671,7 +1675,10 @@ order_api_urls = [
# API endpoints for return order extra line
re_path(r'^ro-extra-line/', include([
path('<int:pk>/', ReturnOrderExtraLineDetail.as_view(), name='api-return-order-extra-line-detail'),
path('<int:pk>/', include([
re_path(r'^metadata/', MetadataView.as_view(), {'model': models.ReturnOrderExtraLine}, name='api-return-order-extra-line-metadata'),
re_path(r'^.*$', ReturnOrderExtraLineDetail.as_view(), name='api-return-order-extra-line-detail'),
])),
path('', ReturnOrderExtraLineList.as_view(), name='api-return-order-extra-line-list'),
])),

View File

@ -1942,7 +1942,7 @@ part_api_urls = [
re_path(r'^parameter/', include([
path('template/', include([
re_path(r'^(?P<pk>\d+)/', include([
re_path(r'^metadata/?', MetadataView.as_view(), {'model': PartParameter}, name='api-part-parameter-template-metadata'),
re_path(r'^metadata/?', MetadataView.as_view(), {'model': PartParameterTemplate}, name='api-part-parameter-template-metadata'),
re_path(r'^.*$', PartParameterTemplateDetail.as_view(), name='api-part-parameter-template-detail'),
])),
re_path(r'^.*$', PartParameterTemplateList.as_view(), name='api-part-parameter-template-list'),