mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Company active filters (#484)
* Add support for "active" status for: - SupplierPart - Company * Add filtering options * Fix default value * Add inactive tiles * Update text and release notes
This commit is contained in:
parent
0e658febe2
commit
a889417fe0
8 changed files with 105 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ class InvenTreeCompany extends InvenTreeModel {
|
|||
|
||||
@override
|
||||
Map<String, Map<String, dynamic>> formFields() {
|
||||
return {
|
||||
Map<String, Map<String, dynamic>> fields = {
|
||||
"name": {},
|
||||
"description": {},
|
||||
"website": {},
|
||||
|
|
@ -32,6 +32,12 @@ class InvenTreeCompany extends InvenTreeModel {
|
|||
"is_customer": {},
|
||||
"currency": {},
|
||||
};
|
||||
|
||||
if (InvenTreeAPI().supportsCompanyActiveStatus) {
|
||||
fields["active"] = {};
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
String get image => (jsondata["image"] ?? jsondata["thumbnail"] ?? InvenTreeAPI.staticImage) as String;
|
||||
|
|
@ -50,6 +56,8 @@ class InvenTreeCompany extends InvenTreeModel {
|
|||
|
||||
bool get isCustomer => getBool("is_customer");
|
||||
|
||||
bool get active => getBool("active", backup: true);
|
||||
|
||||
int get partSuppliedCount => getInt("part_supplied");
|
||||
|
||||
int get partManufacturedCount => getInt("parts_manufactured");
|
||||
|
|
@ -137,6 +145,10 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
|||
fields["pack_quantity"] = {};
|
||||
}
|
||||
|
||||
if (InvenTreeAPI().supportsCompanyActiveStatus) {
|
||||
fields["active"] = {};
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
|
@ -175,6 +187,8 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
|||
String get supplierImage => (jsondata["supplier_detail"]?["image"] ?? jsondata["supplier_detail"]["thumbnail"] ?? InvenTreeAPI.staticThumb) as String;
|
||||
|
||||
String get SKU => getString("SKU");
|
||||
|
||||
bool get active => getBool("active", backup: true);
|
||||
|
||||
int get partId => getInt("part");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue