mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 11:13:17 +00:00
Support logical and custom status fields for models (#758)
* Support logical and custom status fields for models * Update release notes
This commit is contained in:
parent
772c88170e
commit
c5bf4be3d1
4 changed files with 19 additions and 6 deletions
|
|
@ -334,6 +334,24 @@ class InvenTreeModel {
|
|||
|
||||
String get description => getString("description");
|
||||
|
||||
int get logicalStatus => getInt("status");
|
||||
|
||||
int get customStatus => getInt("status_custom_key");
|
||||
|
||||
// Return the effective status of this object
|
||||
// If a custom status is defined, return that, otherwise return the logical status
|
||||
int get status {
|
||||
if (customStatus > 0) {
|
||||
return customStatus;
|
||||
} else {
|
||||
return logicalStatus;
|
||||
}
|
||||
}
|
||||
|
||||
String get statusText => getString("status_text");
|
||||
|
||||
bool get hasCustomStatus => customStatus > 0 && customStatus != status;
|
||||
|
||||
String get notes => getString("notes");
|
||||
|
||||
int get parentId => getInt("parent");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue