mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
fix: rate not being fetched for product bundles in material request
(cherry picked from commit 45c7bac2d0)
# Conflicts:
# erpnext/stock/doctype/packed_item/packed_item.py
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import json
|
||||
|
||||
import frappe
|
||||
import frappe.defaults
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt
|
||||
|
||||
@@ -340,11 +341,24 @@ def on_doctype_update():
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_items_from_product_bundle(row):
|
||||
<<<<<<< HEAD
|
||||
row, items = json.loads(row), []
|
||||
=======
|
||||
row, items = ItemDetailsCtx(json.loads(row)), []
|
||||
defaults = frappe.defaults.get_defaults()
|
||||
>>>>>>> 45c7bac2d0 (fix: rate not being fetched for product bundles in material request)
|
||||
|
||||
bundled_items = get_product_bundle_items(row["item_code"])
|
||||
for item in bundled_items:
|
||||
row.update({"item_code": item.item_code, "qty": flt(row["quantity"]) * flt(item.qty)})
|
||||
row.update(
|
||||
{
|
||||
"item_code": item.item_code,
|
||||
"qty": flt(row["quantity"]) * flt(item.qty),
|
||||
"conversion_rate": 1,
|
||||
"price_list": defaults.buying_price_list,
|
||||
"currency": defaults.currency,
|
||||
}
|
||||
)
|
||||
items.append(get_item_details(row))
|
||||
|
||||
return items
|
||||
|
||||
Reference in New Issue
Block a user