fixed bug with item name in po
This commit is contained in:
parent
57fc4ce046
commit
468078a015
|
|
@ -2409,8 +2409,17 @@ def import_invoice_with_mapping(invoice_data, purchase_order_name=None, schedule
|
||||||
po_item.parentfield = "items"
|
po_item.parentfield = "items"
|
||||||
|
|
||||||
po_item.item_code = mapped_item
|
po_item.item_code = mapped_item
|
||||||
|
|
||||||
|
# ИСПРАВЛЕНИЕ: Получаем название и описание из базы данных Item
|
||||||
|
try:
|
||||||
|
item_doc = frappe.get_doc('Item', mapped_item)
|
||||||
|
po_item.item_name = item_doc.item_name
|
||||||
|
po_item.description = item_doc.description or item_doc.item_name
|
||||||
|
except:
|
||||||
|
# Fallback на название из E-Taxes если не удалось получить из базы
|
||||||
po_item.item_name = item.get("productName", "")
|
po_item.item_name = item.get("productName", "")
|
||||||
po_item.description = item.get("productName", "")
|
po_item.description = item.get("productName", "")
|
||||||
|
|
||||||
po_item.qty = item.get("quantity", 0)
|
po_item.qty = item.get("quantity", 0)
|
||||||
po_item.rate = item.get("pricePerUnit", 0)
|
po_item.rate = item.get("pricePerUnit", 0)
|
||||||
po_item.amount = item.get("cost", 0)
|
po_item.amount = item.get("cost", 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue