diff --git a/app/services/inventory_service.py b/app/services/inventory_service.py index 91dcb874..fce5fb29 100644 --- a/app/services/inventory_service.py +++ b/app/services/inventory_service.py @@ -425,7 +425,7 @@ class InventoryService: return ProductInventorySummary( product_id=product_id, vendor_id=vendor_id, - product_sku=product.product_id, + product_sku=product.vendor_sku, product_title=product.marketplace_product.get_title() or "", total_quantity=total_qty, total_reserved=total_reserved, diff --git a/tests/unit/services/test_inventory_service.py b/tests/unit/services/test_inventory_service.py index 2af7ff11..a152fd5e 100644 --- a/tests/unit/services/test_inventory_service.py +++ b/tests/unit/services/test_inventory_service.py @@ -368,15 +368,24 @@ class TestInventoryService: # Create a new product without inventory from models.database.product import Product from models.database.marketplace_product import MarketplaceProduct + from models.database.marketplace_product_translation import MarketplaceProductTranslation unique_id = str(uuid.uuid4())[:8] mp = MarketplaceProduct( marketplace_product_id=f"MP_EMPTY_{unique_id}", - title="Product Without Inventory", price="29.99", marketplace="Letzshop", ) db.add(mp) + db.flush() + + # Create translation for the product (title is now in translations table) + translation = MarketplaceProductTranslation( + marketplace_product_id=mp.id, + language="en", + title="Product Without Inventory", + ) + db.add(translation) db.commit() product = Product(