mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: field name of price_list in material request
This commit is contained in:
@@ -424,4 +424,5 @@ execute:frappe.db.set_single_value("Accounts Settings", "confirm_before_resettin
|
||||
erpnext.patches.v15_0.rename_pos_closing_entry_fields #2025-06-13
|
||||
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.set_company_on_pos_inv_merge_log
|
||||
erpnext.patches.v15_0.rename_price_list_to_buying_price_list
|
||||
@@ -0,0 +1,11 @@
|
||||
import frappe
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
|
||||
|
||||
def execute():
|
||||
if frappe.db.has_column("Material Request", "price_list"):
|
||||
rename_field(
|
||||
"Material Request",
|
||||
"price_list",
|
||||
"buying_price_list",
|
||||
)
|
||||
@@ -582,7 +582,6 @@ erpnext.buying.get_items_from_product_bundle = function(frm) {
|
||||
ignore_pricing_rule: frm.doc.ignore_pricing_rule,
|
||||
doctype: frm.doc.doctype
|
||||
},
|
||||
price_list: frm.doc.price_list,
|
||||
},
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
|
||||
@@ -43,7 +43,7 @@ frappe.ui.form.on("Material Request", {
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("price_list", () => {
|
||||
frm.set_query("buying_price_list", () => {
|
||||
return {
|
||||
filters: {
|
||||
buying: 1,
|
||||
@@ -87,7 +87,7 @@ frappe.ui.form.on("Material Request", {
|
||||
});
|
||||
|
||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
||||
frm.doc.price_list = frappe.defaults.get_default("buying_price_list");
|
||||
frm.doc.buying_price_list = frappe.defaults.get_default("buying_price_list");
|
||||
},
|
||||
|
||||
company: function (frm) {
|
||||
@@ -269,8 +269,8 @@ frappe.ui.form.on("Material Request", {
|
||||
from_warehouse: item.from_warehouse,
|
||||
warehouse: item.warehouse,
|
||||
doctype: frm.doc.doctype,
|
||||
buying_price_list: frm.doc.price_list
|
||||
? frm.doc.price_list
|
||||
buying_price_list: frm.doc.buying_price_list
|
||||
? frm.doc.buying_price_list
|
||||
: frappe.defaults.get_default("buying_price_list"),
|
||||
currency: frappe.defaults.get_default("Currency"),
|
||||
name: frm.doc.name,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"column_break_2",
|
||||
"transaction_date",
|
||||
"schedule_date",
|
||||
"price_list",
|
||||
"buying_price_list",
|
||||
"amended_from",
|
||||
"warehouse_section",
|
||||
"scan_barcode",
|
||||
@@ -354,7 +354,7 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "price_list",
|
||||
"fieldname": "buying_price_list",
|
||||
"fieldtype": "Link",
|
||||
"label": "Price List",
|
||||
"options": "Price List"
|
||||
@@ -364,7 +364,7 @@
|
||||
"idx": 70,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2025-07-07 13:15:28.615984",
|
||||
"modified": "2025-07-11 21:03:26.588307",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Material Request",
|
||||
|
||||
@@ -163,8 +163,8 @@ class MaterialRequest(BuyingController):
|
||||
|
||||
self.validate_pp_qty()
|
||||
|
||||
if not self.price_list:
|
||||
self.price_list = frappe.defaults.get_defaults().buying_price_list
|
||||
if not self.buying_price_list:
|
||||
self.buying_price_list = frappe.defaults.get_defaults().buying_price_list
|
||||
|
||||
def validate_pp_qty(self):
|
||||
items_from_pp = [item for item in self.items if item.material_request_plan_item]
|
||||
|
||||
@@ -349,7 +349,7 @@ def on_doctype_update():
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_items_from_product_bundle(row, price_list):
|
||||
def get_items_from_product_bundle(row):
|
||||
row, items = ItemDetailsCtx(json.loads(row)), []
|
||||
|
||||
bundled_items = get_product_bundle_items(row["item_code"])
|
||||
@@ -359,7 +359,6 @@ def get_items_from_product_bundle(row, price_list):
|
||||
"item_code": item.item_code,
|
||||
"qty": flt(row["quantity"]) * flt(item.qty),
|
||||
"conversion_rate": 1,
|
||||
"price_list": price_list,
|
||||
"currency": frappe.defaults.get_defaults().currency,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user