2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

Add support for "modern" stock actions via the API

- In the future, will have to deprecate support for the old ways
- Probably v0.6.x?
This commit is contained in:
Oliver
2021-10-05 22:45:47 +11:00
parent 91ec55967d
commit ba41ebde73
3 changed files with 165 additions and 11 deletions

View File

@ -225,6 +225,8 @@ class InvenTreeAPI {
// API version of the connected server
int _apiVersion = 1;
int get apiVersion => _apiVersion;
// Getter for server version information
String get version => _version;
@ -244,10 +246,14 @@ class InvenTreeAPI {
// Ensure we only ever create a single instance of the API class
static final InvenTreeAPI _api = InvenTreeAPI._internal();
// API endpoint for receiving purchase order line items was introduced in v12
bool supportPoReceive() {
return apiVersion >= 12;
}
// API endpoint for receiving purchase order line items was introduced in v12
return _apiVersion >= 12;
// "Modern" API transactions were implemented in API v14
bool supportModernStockTransactions() {
return apiVersion >= 14;
}
/*