Change order custom status via api#11982
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8c299e9 to
37783d2
Compare
|
@johnluetke nice clean implementation :) |
matmair
left a comment
There was a problem hiding this comment.
Looks good;
there are a few formatting things, those could be fixed with pre-commit or prek; I will submit them shortly
| # can be set directly, but must be valid for the current order status | ||
| status_custom_key = serializers.IntegerField( | ||
| label=_('Custom Status Key'), | ||
| help_text=_('Update order status to a custom value for this logical value'), |
There was a problem hiding this comment.
With this set we loose dynamic choice enumeration in the schema description; @SchrodingersGat is that acceptable or should we patch the schema generation mechanism
There was a problem hiding this comment.
I've been trying to familiarize myself with how this works, but don't quite understand how it broke. It seems like the schema now thinks that the status and custom_status_key fields are more tightly coupled now?
If you can point me in the right direction, I can see if my solution can be implemented in a way that doesn't change this.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11982 +/- ##
=======================================
Coverage 91.23% 91.24%
=======================================
Files 971 971
Lines 51103 51149 +46
=======================================
+ Hits 46626 46670 +44
- Misses 4477 4479 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Refactor `custom_status_key` to be writable via the API and validate that the proposed value is valid for the current order status
423a9bf to
b1a0243
Compare

Fixes #11927
As discussed in the issue, an order's custom status key can be updated via the API.
Validation has been added to ensure that the custom_status_key value is aligned to the current logical state of the order.