mirror of
https://github.com/inventree/inventree-app.git
synced 2026-04-25 19:03:25 +00:00
Build Order (#673)
* WIP * Remove debug msg * Add required roles * More roles * Fix refresh for BuildDetail widget * Add attachments widget * Translated text * Further updates * More translations * Form field updates * Cleanup * Code formatting * Fix duplicate import * formatting * Remove duplicate switch case * Update to match modern app * Improved required parts list * Filtering for build outputs * Display list of allocated stock items * Display source and destination locations * Fix typo * Add build orders to drawer * Fix hard-coded string * Set default filter value * Tweak build fields (remove "notes") * Fixes * Add "start_date" to build edit form * Disable editing of build line * Tweak build item / build detail views * Remove unused func * Remove unused import --------- Co-authored-by: Asterix\Oliver <oliver@currawongeng.com> Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import "package:inventree/widget/stock/location_display.dart";
|
||||
import "package:inventree/widget/part/part_list.dart";
|
||||
import "package:inventree/widget/order/purchase_order_list.dart";
|
||||
import "package:inventree/widget/order/sales_order_list.dart";
|
||||
import "package:inventree/widget/build/build_list.dart";
|
||||
import "package:inventree/widget/refreshable_state.dart";
|
||||
import "package:inventree/widget/snacks.dart";
|
||||
import "package:inventree/widget/spinner.dart";
|
||||
@@ -57,6 +58,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage>
|
||||
bool homeShowPo = false;
|
||||
bool homeShowSo = false;
|
||||
bool homeShowShipments = false;
|
||||
bool homeShowBuild = false;
|
||||
bool homeShowSubscribed = false;
|
||||
bool homeShowManufacturers = false;
|
||||
bool homeShowCustomers = false;
|
||||
@@ -128,6 +130,17 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
void _showBuildOrders(BuildContext context) {
|
||||
if (!InvenTreeAPI().checkConnection()) return;
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => BuildOrderListWidget(filters: {}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showSuppliers(BuildContext context) {
|
||||
if (!InvenTreeAPI().checkConnection()) return;
|
||||
|
||||
@@ -188,6 +201,10 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage>
|
||||
await InvenTreeSettingsManager().getValue(INV_HOME_SHOW_SHIPMENTS, true)
|
||||
as bool;
|
||||
|
||||
homeShowBuild =
|
||||
await InvenTreeSettingsManager().getValue(INV_HOME_SHOW_BUILD, true)
|
||||
as bool;
|
||||
|
||||
homeShowManufacturers =
|
||||
await InvenTreeSettingsManager().getValue(
|
||||
INV_HOME_SHOW_MANUFACTURERS,
|
||||
@@ -319,6 +336,22 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
// Build Orders
|
||||
if (homeShowBuild && InvenTreeAPI().checkRole("build", "view")) {
|
||||
tiles.add(
|
||||
_listTile(
|
||||
context,
|
||||
L10().buildOrders,
|
||||
TablerIcons.building_factory,
|
||||
callback: () {
|
||||
_showBuildOrders(context);
|
||||
},
|
||||
role: "build",
|
||||
permission: "view",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Purchase orders
|
||||
if (homeShowPo && InvenTreePurchaseOrder().canView) {
|
||||
tiles.add(
|
||||
|
||||
Reference in New Issue
Block a user