mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 01:25:07 +00:00
fix: field name of price_list in material request
(cherry picked from commit adb9a6bc15)
# Conflicts:
# erpnext/patches.txt
# erpnext/stock/doctype/material_request/material_request.py
# erpnext/stock/doctype/packed_item/packed_item.py
This commit is contained in:
@@ -411,4 +411,10 @@ erpnext.patches.v14_0.update_full_name_in_contract
|
|||||||
erpnext.patches.v15_0.drop_sle_indexes
|
erpnext.patches.v15_0.drop_sle_indexes
|
||||||
erpnext.patches.v15_0.update_pick_list_fields
|
erpnext.patches.v15_0.update_pick_list_fields
|
||||||
erpnext.patches.v15_0.update_pegged_currencies
|
erpnext.patches.v15_0.update_pegged_currencies
|
||||||
|
<<<<<<< HEAD
|
||||||
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.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
|
||||||
|
>>>>>>> adb9a6bc15 (fix: field name of price_list in material request)
|
||||||
|
|||||||
@@ -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,
|
ignore_pricing_rule: frm.doc.ignore_pricing_rule,
|
||||||
doctype: frm.doc.doctype
|
doctype: frm.doc.doctype
|
||||||
},
|
},
|
||||||
price_list: frm.doc.price_list,
|
|
||||||
},
|
},
|
||||||
freeze: true,
|
freeze: true,
|
||||||
callback: function(r) {
|
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 {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
buying: 1,
|
buying: 1,
|
||||||
@@ -79,7 +79,7 @@ frappe.ui.form.on("Material Request", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
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) {
|
company: function (frm) {
|
||||||
@@ -255,8 +255,8 @@ frappe.ui.form.on("Material Request", {
|
|||||||
from_warehouse: item.from_warehouse,
|
from_warehouse: item.from_warehouse,
|
||||||
warehouse: item.warehouse,
|
warehouse: item.warehouse,
|
||||||
doctype: frm.doc.doctype,
|
doctype: frm.doc.doctype,
|
||||||
buying_price_list: frm.doc.price_list
|
buying_price_list: frm.doc.buying_price_list
|
||||||
? frm.doc.price_list
|
? frm.doc.buying_price_list
|
||||||
: frappe.defaults.get_default("buying_price_list"),
|
: frappe.defaults.get_default("buying_price_list"),
|
||||||
currency: frappe.defaults.get_default("Currency"),
|
currency: frappe.defaults.get_default("Currency"),
|
||||||
name: frm.doc.name,
|
name: frm.doc.name,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
"column_break_2",
|
"column_break_2",
|
||||||
"transaction_date",
|
"transaction_date",
|
||||||
"schedule_date",
|
"schedule_date",
|
||||||
"price_list",
|
"buying_price_list",
|
||||||
"amended_from",
|
"amended_from",
|
||||||
"warehouse_section",
|
"warehouse_section",
|
||||||
"scan_barcode",
|
"scan_barcode",
|
||||||
@@ -354,7 +354,7 @@
|
|||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "price_list",
|
"fieldname": "buying_price_list",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Price List",
|
"label": "Price List",
|
||||||
"options": "Price List"
|
"options": "Price List"
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
"idx": 70,
|
"idx": 70,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-07-07 13:15:28.615984",
|
"modified": "2025-07-11 21:03:26.588307",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Material Request",
|
"name": "Material Request",
|
||||||
|
|||||||
@@ -153,8 +153,15 @@ class MaterialRequest(BuyingController):
|
|||||||
self.reset_default_field_value("set_warehouse", "items", "warehouse")
|
self.reset_default_field_value("set_warehouse", "items", "warehouse")
|
||||||
self.reset_default_field_value("set_from_warehouse", "items", "from_warehouse")
|
self.reset_default_field_value("set_from_warehouse", "items", "from_warehouse")
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
if not self.price_list:
|
if not self.price_list:
|
||||||
self.price_list = frappe.defaults.get_defaults().buying_price_list
|
self.price_list = frappe.defaults.get_defaults().buying_price_list
|
||||||
|
=======
|
||||||
|
self.validate_pp_qty()
|
||||||
|
|
||||||
|
if not self.buying_price_list:
|
||||||
|
self.buying_price_list = frappe.defaults.get_defaults().buying_price_list
|
||||||
|
>>>>>>> adb9a6bc15 (fix: field name of price_list in material request)
|
||||||
|
|
||||||
def before_update_after_submit(self):
|
def before_update_after_submit(self):
|
||||||
self.validate_schedule_date()
|
self.validate_schedule_date()
|
||||||
|
|||||||
@@ -340,8 +340,13 @@ def on_doctype_update():
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
<<<<<<< HEAD
|
||||||
def get_items_from_product_bundle(row, price_list):
|
def get_items_from_product_bundle(row, price_list):
|
||||||
row, items = json.loads(row), []
|
row, items = json.loads(row), []
|
||||||
|
=======
|
||||||
|
def get_items_from_product_bundle(row):
|
||||||
|
row, items = ItemDetailsCtx(json.loads(row)), []
|
||||||
|
>>>>>>> adb9a6bc15 (fix: field name of price_list in material request)
|
||||||
|
|
||||||
bundled_items = get_product_bundle_items(row["item_code"])
|
bundled_items = get_product_bundle_items(row["item_code"])
|
||||||
for item in bundled_items:
|
for item in bundled_items:
|
||||||
@@ -350,7 +355,6 @@ def get_items_from_product_bundle(row, price_list):
|
|||||||
"item_code": item.item_code,
|
"item_code": item.item_code,
|
||||||
"qty": flt(row["quantity"]) * flt(item.qty),
|
"qty": flt(row["quantity"]) * flt(item.qty),
|
||||||
"conversion_rate": 1,
|
"conversion_rate": 1,
|
||||||
"price_list": price_list,
|
|
||||||
"currency": frappe.defaults.get_defaults().currency,
|
"currency": frappe.defaults.get_defaults().currency,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user