mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: patch to set default buying price list in material request (#48680)
* fix: patch to set default buying price list in material request
This commit is contained in:
@@ -426,4 +426,5 @@ erpnext.patches.v15_0.update_pegged_currencies
|
||||
erpnext.patches.v15_0.set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user