Merge pull request #48682 from frappe/mergify/bp/version-15-hotfix/pr-48680

fix: patch to set default buying price list in material request (backport #48680)
This commit is contained in:
Mihir Kandoi
2025-07-29 13:23:16 +05:30
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -413,6 +413,7 @@ erpnext.patches.v15_0.update_pick_list_fields
erpnext.patches.v15_0.update_pegged_currencies
erpnext.patches.v15_0.set_company_on_pos_inv_merge_log
erpnext.patches.v15_0.rename_price_list_to_buying_price_list
erpnext.patches.v15_0.patch_missing_buying_price_list_in_material_request
erpnext.patches.v15_0.remove_sales_partner_from_consolidated_sales_invoice
erpnext.patches.v15_0.repost_gl_entries_with_no_account_subcontracting
execute:frappe.db.set_single_value("Accounts Settings", "fetch_valuation_rate_for_internal_transaction", 1)

View File

@@ -0,0 +1,13 @@
import frappe
import frappe.defaults
def execute():
if frappe.db.has_column("Material Request", "buying_price_list") and (
default_buying_price_list := frappe.defaults.get_defaults().buying_price_list
):
docs = frappe.get_all(
"Material Request", filters={"buying_price_list": ["is", "not set"], "docstatus": 1}, pluck="name"
)
for doc in docs:
frappe.db.set_value("Material Request", doc, "buying_price_list", default_buying_price_list)