mirror of
https://github.com/inventree/inventree-app.git
synced 2025-08-07 04:52:08 +00:00
Label printing fix (#489)
* Add check for modern label printing interface * Update getLabelTemplates * Fix typo * Refactor / simplify * Revert parameter type * Update version number and release notes * Refactor label printing function - Will require some cleanup in the future - Still needs testing * Fix for modern printing * Typo fix
This commit is contained in:
@@ -138,6 +138,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
selectAndPrintLabel(
|
||||
context,
|
||||
labels,
|
||||
widget.item.pk,
|
||||
"stock",
|
||||
"item=${widget.item.pk}"
|
||||
);
|
||||
@@ -264,10 +265,17 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
|
||||
// Request information on labels available for this stock item
|
||||
if (allowLabelPrinting) {
|
||||
|
||||
String model_type = api.supportsModenLabelPrinting ? InvenTreeStockLocation().MODEL_TYPE : "stock";
|
||||
String item_key = api.supportsModenLabelPrinting ? "items" : "item";
|
||||
|
||||
// Clear the existing labels list
|
||||
_labels = await getLabelTemplates("stock", {
|
||||
"item": widget.item.pk.toString()
|
||||
});
|
||||
_labels = await getLabelTemplates(
|
||||
model_type,
|
||||
{
|
||||
item_key: widget.item.pk.toString()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
|
Reference in New Issue
Block a user