2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00

Sales order support (#438)

* Add new models for SalesOrder

- Create generic Order and OrderLine models with common functionality

* Refactor

- Move some widgets around
- Cleanup directory structure

* Add link to home screen and nav drawer

* Add SalesOrder list widget

* Linting fixes

* Fix string

* Refactor PurchaseOrderDetailWidget

* Tweaks to existing code

* linting

* Fixes for drawer widget

* Add "detail" page for SalesOrder

* Add more tiles to SalesOrder detail

* Allow editing of salesorder

* add list filters for sales orders

* Display list of line items

* Customer updates

- Display customer icon on home screen
- Fetch sales orders for customer detail page

* Cleanup company detail view

* Create new sales order from list

* Stricter typing for formFields method

* Create new PurchaseOrder and SalesOrder from company deatil

* Status code updates

- Add function for name comparison
- Remove hard-coded values

* Update view permission checks for home widget

* Add ability to manually add SalesOrderLineItem

* Add nice progress bar widgets

* Display detail view for sales order line item

* edit SalesOrderLineItem

* Fix unused import

* Hide "shipped items" tab

- Will be added in a future update
This commit is contained in:
Oliver
2023-11-12 23:13:22 +11:00
committed by GitHub
parent c1c0d46957
commit bdd5470e68
45 changed files with 1565 additions and 284 deletions

View File

@ -620,6 +620,8 @@ class InvenTreeAPI {
_globalSettings.clear();
_userSettings.clear();
roles.clear();
_plugins.clear();
serverInfo.clear();
_connectionStatusChanged();
}
@ -672,6 +674,8 @@ class InvenTreeAPI {
_connectionStatusChanged();
fetchStatusCodeData();
return _connected;
}
@ -735,6 +739,10 @@ class InvenTreeAPI {
*/
bool checkPermission(String role, String permission) {
if (!_connected) {
return false;
}
// If we do not have enough information, assume permission is allowed
if (roles.isEmpty) {
debug("checkPermission - no roles defined!");
@ -1624,11 +1632,20 @@ class InvenTreeAPI {
InvenTreeStatusCode get StockHistoryStatus => _get_status_class("stock/track/status/");
InvenTreeStatusCode get StockStatus => _get_status_class("stock/status/");
InvenTreeStatusCode get PurchaseOrderStatus => _get_status_class("order/po/status/");
InvenTreeStatusCode get SalesOrderStatus => _get_status_class("order/so/status/");
void clearStatusCodeData() {
StockHistoryStatus.data.clear();
StockStatus.data.clear();
PurchaseOrderStatus.data.clear();
SalesOrderStatus.data.clear();
}
Future<void> fetchStatusCodeData({bool forceReload = true}) async {
StockHistoryStatus.load(forceReload: forceReload);
StockStatus.load(forceReload: forceReload);
PurchaseOrderStatus.load(forceReload: forceReload);
SalesOrderStatus.load(forceReload: forceReload);
}
int notification_counter = 0;