mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-04 07:15:46 +00:00 
			
		
		
		
	Merge branch 'master' into api-forms
This commit is contained in:
		@@ -1,6 +1,13 @@
 | 
			
		||||
## InvenTree App Release Notes
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### 0.2.10 - July 2021
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- Add "last updated" date to StockDetail view
 | 
			
		||||
- Add "stocktake" date to StockDetail view
 | 
			
		||||
- Display location of stock items in list view
 | 
			
		||||
 | 
			
		||||
### 0.2.9 - July 2021
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@ export "COCOAPODS_PARALLEL_CODE_SIGN=true"
 | 
			
		||||
export "FLUTTER_TARGET=lib\main.dart"
 | 
			
		||||
export "FLUTTER_BUILD_DIR=build"
 | 
			
		||||
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
 | 
			
		||||
export "FLUTTER_BUILD_NAME=0.2.9"
 | 
			
		||||
export "FLUTTER_BUILD_NUMBER=17"
 | 
			
		||||
export "FLUTTER_BUILD_NAME=0.2.10"
 | 
			
		||||
export "FLUTTER_BUILD_NUMBER=18"
 | 
			
		||||
export "DART_OBFUSCATION=false"
 | 
			
		||||
export "TRACK_WIDGET_CREATION=false"
 | 
			
		||||
export "TREE_SHAKE_ICONS=false"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import 'package:intl/intl.dart';
 | 
			
		||||
import 'package:inventree/inventree/part.dart';
 | 
			
		||||
import 'package:flutter/cupertino.dart';
 | 
			
		||||
import 'package:http/http.dart' as http;
 | 
			
		||||
@@ -222,20 +223,46 @@ class InvenTreeStockItem extends InvenTreeModel {
 | 
			
		||||
  int get trackingItemCount => (jsondata['tracking_items'] ?? 0) as int;
 | 
			
		||||
 | 
			
		||||
  // Date of last update
 | 
			
		||||
  String get updated => jsondata["updated"] ?? "";
 | 
			
		||||
 | 
			
		||||
  DateTime? get stocktakeDate {
 | 
			
		||||
    if (jsondata.containsKey("stocktake_date")) {
 | 
			
		||||
      if (jsondata["stocktake_date"] == null) {
 | 
			
		||||
        return null;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return DateTime.tryParse(jsondata["stocktake_date"]) ?? null;
 | 
			
		||||
  DateTime? get updatedDate {
 | 
			
		||||
    if (jsondata.containsKey("updated")) {
 | 
			
		||||
      return DateTime.tryParse(jsondata["updated"] ?? '');
 | 
			
		||||
    } else {
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String? get updatedDateString {
 | 
			
		||||
    var _updated = updatedDate;
 | 
			
		||||
 | 
			
		||||
    if (_updated == null) {
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final DateFormat _format = DateFormat("yyyy-MM-dd");
 | 
			
		||||
 | 
			
		||||
    return _format.format(_updated);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  DateTime? get stocktakeDate {
 | 
			
		||||
    if (jsondata.containsKey("stocktake_date")) {
 | 
			
		||||
      return DateTime.tryParse(jsondata["stocktake_date"] ?? '');
 | 
			
		||||
    } else {
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String? get stocktakeDateString {
 | 
			
		||||
    var _stocktake = stocktakeDate;
 | 
			
		||||
 | 
			
		||||
    if (_stocktake == null) {
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final DateFormat _format = DateFormat("yyyy-MM-dd");
 | 
			
		||||
 | 
			
		||||
    return _format.format(_stocktake);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String get partName {
 | 
			
		||||
 | 
			
		||||
    String nm = '';
 | 
			
		||||
@@ -388,7 +415,13 @@ class InvenTreeStockItem extends InvenTreeModel {
 | 
			
		||||
 | 
			
		||||
    if (locationId == -1 || !jsondata.containsKey('location_detail')) return L10().locationNotSet;
 | 
			
		||||
 | 
			
		||||
    return jsondata['location_detail']['pathstring'] ?? '';
 | 
			
		||||
    String _loc = jsondata['location_detail']['pathstring'] ?? '';
 | 
			
		||||
 | 
			
		||||
    if (_loc.isNotEmpty) {
 | 
			
		||||
      return _loc;
 | 
			
		||||
    } else {
 | 
			
		||||
      return locationName;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String get displayQuantity {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							 Submodule lib/l10n updated: 0870256fb9...af4cd9026a
									
								
							@@ -517,7 +517,7 @@ class _PaginatedStockListState extends State<PaginatedStockList> {
 | 
			
		||||
  Widget _buildItem(BuildContext context, InvenTreeStockItem item) {
 | 
			
		||||
    return ListTile(
 | 
			
		||||
      title: Text("${item.partName}"),
 | 
			
		||||
      subtitle: Text("${item.partDescription}"),
 | 
			
		||||
      subtitle: Text("${item.locationPathString}"),
 | 
			
		||||
      leading: InvenTreeAPI().getImage(
 | 
			
		||||
        item.partThumbnail,
 | 
			
		||||
        width: 40,
 | 
			
		||||
 
 | 
			
		||||
@@ -418,7 +418,32 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Last update?
 | 
			
		||||
    var update_date = item.updatedDateString;
 | 
			
		||||
 | 
			
		||||
    if (update_date != null) {
 | 
			
		||||
 | 
			
		||||
      tiles.add(
 | 
			
		||||
        ListTile(
 | 
			
		||||
          title: Text(L10().lastUpdated),
 | 
			
		||||
          subtitle: Text(update_date),
 | 
			
		||||
          leading: FaIcon(FontAwesomeIcons.calendarAlt)
 | 
			
		||||
        )
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Stocktake?
 | 
			
		||||
    var stocktake_date = item.stocktakeDateString;
 | 
			
		||||
 | 
			
		||||
    if (stocktake_date != null) {
 | 
			
		||||
      tiles.add(
 | 
			
		||||
        ListTile(
 | 
			
		||||
          title: Text(L10().lastStocktake),
 | 
			
		||||
          subtitle: Text(stocktake_date),
 | 
			
		||||
          leading: FaIcon(FontAwesomeIcons.calendarAlt)
 | 
			
		||||
        )
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Supplier part?
 | 
			
		||||
    // TODO: Display supplier part info page?
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ description: InvenTree stock management
 | 
			
		||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
 | 
			
		||||
# Read more about iOS versioning at
 | 
			
		||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 | 
			
		||||
version: 0.2.9+17
 | 
			
		||||
version: 0.2.10+18
 | 
			
		||||
 | 
			
		||||
environment:
 | 
			
		||||
  sdk: ">=2.12.0 <3.0.0"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user