mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
Merge pull request #48396 from frappe/mergify/bp/version-15-hotfix/pr-48372
fix: rate not being fetched for product bundles in material request (backport #48372)
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
|
||||
|
||||
@@ -341,10 +342,19 @@ def on_doctype_update():
|
||||
@frappe.whitelist()
|
||||
def get_items_from_product_bundle(row):
|
||||
row, items = json.loads(row), []
|
||||
defaults = frappe.defaults.get_defaults()
|
||||
|
||||
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