Skip to content

PurchaseOrder PATCH accepts status_custom_key, but does not persist valid custom status #11927

@johnluetke

Description

@johnluetke

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

PATCH /api/order/po/{id}/ appears to accept status_custom_key, but a valid custom status is not persisted.

Steps to Reproduce

  1. Confirm custom PO status exists via API: GET /api/generic/status/custom/?reference_status=PurchaseOrderStatus
[
  {
    "key": 110,
    "name": "NEEDS_APPROVAL",
    "label": "Needs Approval",
    "logical_key": 10,
    "reference_status": "PurchaseOrderStatus"
  }
]
  1. Confirm target PurchaseOrder is has correct logical status.
{
  "pk": 282,
  "status": 10,
  "status_text": "Pending",
  "status_custom_key": 10
}
  1. PATCH with valid custom key for the current logicial status
curl --request PATCH \
  --url https://<host>/api/order/po/282/ \
  --header 'Authorization: Token <redacted>' \
  --header 'Content-Type: application/json' \
  --data '{
    "status_custom_key": 110
  }'

Expected behaviour

status_custom_key should persist.

{
  "status": 10,
  "status_custom_key": 110
}

Deployment Method

None

Version Information

Inventree version 1.3.2
API version 477
Python 3.14.3
Django 5.2.13
Commit Hash a60e85b

Try to reproduce on the demo site

I tried to reproduce

Is the bug reproducible on the demo site?

Reproducible

Relevant log output

Metadata

Metadata

Assignees

Labels

apiRelates to the APIbugIdentifies a bug which needs to be addressedquestionThis is a question

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions