From 715cd069468263e3b28afa8f5b5da47ecabf36f7 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 3 Jun 2024 21:50:24 +1000 Subject: [PATCH] Long sn fix (#499) * Improve tasks.py - Works from any subdir now * Update stock detail display * FIx width of "serial" column in stock item list --- lib/widget/stock/stock_detail.dart | 4 ++-- lib/widget/stock/stock_list.dart | 17 ++++++++++------- tasks.py | 8 +++++++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/widget/stock/stock_detail.dart b/lib/widget/stock/stock_detail.dart index 12c7deaa..b98b2d42 100644 --- a/lib/widget/stock/stock_detail.dart +++ b/lib/widget/stock/stock_detail.dart @@ -467,7 +467,7 @@ class _StockItemDisplayState extends RefreshableState { title: Text("${widget.item.partName}"), subtitle: Text("${widget.item.partDescription}"), leading: InvenTreeAPI().getThumbnail(widget.item.partImage), - trailing: Text( + trailing: widget.item.isSerialized() ? null : Text( widget.item.quantityString(), style: TextStyle( fontSize: 20, @@ -548,7 +548,7 @@ class _StockItemDisplayState extends RefreshableState { ListTile( title: Text(L10().serialNumber), leading: FaIcon(FontAwesomeIcons.hashtag), - trailing: Text("${widget.item.serialNumber}"), + subtitle: Text("${widget.item.serialNumber}"), ) ); } else { diff --git a/lib/widget/stock/stock_list.dart b/lib/widget/stock/stock_list.dart index c24c35ca..dd36a303 100644 --- a/lib/widget/stock/stock_list.dart +++ b/lib/widget/stock/stock_list.dart @@ -133,14 +133,17 @@ class _PaginatedStockItemListState extends PaginatedSearchState StockDetailWidget(item))); diff --git a/tasks.py b/tasks.py index feda09d6..04b6830a 100644 --- a/tasks.py +++ b/tasks.py @@ -1,5 +1,6 @@ """Invoke tasks for building the app""" +import os import sys from invoke import task @@ -13,8 +14,13 @@ def clean(c): @task def translate(c): """Update translation files""" + + here = os.path.dirname(__file__) + l10_dir = os.path.join(here, 'lib', 'l10n') + l10_dir = os.path.abspath(l10_dir) + python = 'python3' if sys.platform.lower() == 'darwin' else 'python' - c.run(f"cd lib/l10n && {python} collect_translations.py") + c.run(f"cd {l10_dir} && {python} collect_translations.py") @task(pre=[clean, translate])