fix(api): globally replace invalid material_base/material_name attributes with correct base relationship

This commit is contained in:
DXC
2026-03-26 17:14:26 +08:00
parent d58b002340
commit c8810891d8
3 changed files with 10 additions and 10 deletions

View File

@ -184,10 +184,10 @@ class ScrapService:
'id': item.id,
'sku': item.sku,
'barcode': item.barcode,
'name': item.material_base.name if item.material_base else '',
'spec': item.material_base.spec_model if item.material_base else '',
'category': item.material_base.category if item.material_base else '',
'material_type': item.material_base.material_type if item.material_base else '',
'name': item.base.name if item.base else '',
'spec': item.base.spec_model if item.base else '',
'category': item.base.category if item.base else '',
'material_type': item.base.material_type if item.base else '',
'warehouse_loc': item.warehouse_loc or '',
'stock_quantity': stock_qty,
'available_quantity': avail_qty,