Changeset - 6fa39f685829
[Not reviewed]
default
0 1 0
Dennis Fink - 3 years ago 2022-02-28 19:00:33
dennis.fink@c3l.lu
Fix stock_amount not being an integer
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
stockcli/stock.py
Show inline comments
 
@@ -51,25 +51,25 @@ def get_info_by_barcode(barcode: str) ->
 
        conversion = ""
 

	
 
    grid.add_row(
 
        GreenBoldText("Purchase Quantity Unit:"),
 
        purchase_quantity_unit["name"],
 
        conversion,
 
    )
 
    grid.add_row(
 
        GreenBoldText("Stock Quantity Unit:"),
 
        stock_quantity_unit["name"],
 
    )
 

	
 
    stock_amount = product["stock_amount"]
 
    stock_amount = int(product["stock_amount"])
 
    grid.add_row(GreenBoldText("Overall Stock Amount:"), str(stock_amount))
 

	
 
    if stock_amount > 0:
 
        grid.add_row(GreenBoldText("Locations:"))
 
        locations = utils.get_request(
 
            f"stock/products/{product_id}/locations"
 
        )  # type: list[dict[str, Any]]
 

	
 
        for location in sorted(locations, key=itemgetter("location_name")):
 
            grid.add_row(
 
                f"[green bold]-[/green bold] [magenta]{location['location_name']}[/magenta]",
 
                location["amount"],
0 comments (0 inline, 0 general)