fix: prevent spurious defaults for items when making prec from dnote (#25559)
* fix: prevent spurious defaults for items when making prec from dnote * refactor: make concise, use dict comp
This commit is contained in:
parent
4ecae62194
commit
0e0de6baa1
@ -1755,15 +1755,10 @@ def update_pr_items(doc, sales_item_map, purchase_item_map, parent_child_map, wa
|
|||||||
item.purchase_order = parent_child_map.get(sales_item_map.get(item.delivery_note_item))
|
item.purchase_order = parent_child_map.get(sales_item_map.get(item.delivery_note_item))
|
||||||
|
|
||||||
def get_delivery_note_details(internal_reference):
|
def get_delivery_note_details(internal_reference):
|
||||||
so_item_map = {}
|
|
||||||
|
|
||||||
si_item_details = frappe.get_all('Delivery Note Item', fields=['name', 'so_detail'],
|
si_item_details = frappe.get_all('Delivery Note Item', fields=['name', 'so_detail'],
|
||||||
filters={'parent': internal_reference})
|
filters={'parent': internal_reference})
|
||||||
|
|
||||||
for d in si_item_details:
|
return {d.name: d.so_detail for d in si_item_details if d.so_detail}
|
||||||
so_item_map.setdefault(d.name, d.so_detail)
|
|
||||||
|
|
||||||
return so_item_map
|
|
||||||
|
|
||||||
def get_sales_invoice_details(internal_reference):
|
def get_sales_invoice_details(internal_reference):
|
||||||
dn_item_map = {}
|
dn_item_map = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user