mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 22:19:18 +00:00
chore: make unnecessary field read only and show only when required
This commit is contained in:
@@ -35,15 +35,6 @@ frappe.ui.form.on("Purchase Receipt", {
|
|||||||
filters: { company: frm.doc.company },
|
filters: { company: frm.doc.company },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_query("subcontracting_receipt", function () {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
docstatus: 1,
|
|
||||||
supplier: frm.doc.supplier,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onload: function (frm) {
|
onload: function (frm) {
|
||||||
erpnext.queries.setup_queries(frm, "Warehouse", function () {
|
erpnext.queries.setup_queries(frm, "Warehouse", function () {
|
||||||
@@ -167,24 +158,6 @@ frappe.ui.form.on("Purchase Receipt", {
|
|||||||
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
||||||
},
|
},
|
||||||
|
|
||||||
subcontracting_receipt: (frm) => {
|
|
||||||
if (
|
|
||||||
frm.doc.is_subcontracted === 1 &&
|
|
||||||
frm.doc.is_old_subcontracting_flow === 0 &&
|
|
||||||
frm.doc.subcontracting_receipt
|
|
||||||
) {
|
|
||||||
frm.set_value("items", null);
|
|
||||||
|
|
||||||
erpnext.utils.map_current_doc({
|
|
||||||
method: "erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_purchase_receipt",
|
|
||||||
source_name: frm.doc.subcontracting_receipt,
|
|
||||||
target_doc: frm,
|
|
||||||
freeze: true,
|
|
||||||
freeze_message: __("Mapping Purchase Receipt ..."),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
toggle_display_account_head: function (frm) {
|
toggle_display_account_head: function (frm) {
|
||||||
var enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company);
|
var enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company);
|
||||||
frm.fields_dict["items"].grid.set_column_disp(["cost_center"], enabled);
|
frm.fields_dict["items"].grid.set_column_disp(["cost_center"], enabled);
|
||||||
|
|||||||
@@ -1249,11 +1249,12 @@
|
|||||||
"label": "Named Place"
|
"label": "Named Place"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval: (doc.is_subcontracted && !doc.is_old_subcontracting_flow)",
|
"depends_on": "subcontracting_receipt",
|
||||||
"fieldname": "subcontracting_receipt",
|
"fieldname": "subcontracting_receipt",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Subcontracting Receipt",
|
"label": "Subcontracting Receipt",
|
||||||
"options": "Subcontracting Receipt",
|
"options": "Subcontracting Receipt",
|
||||||
|
"read_only": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1309,7 +1310,7 @@
|
|||||||
"idx": 261,
|
"idx": 261,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-11-12 19:53:48.173096",
|
"modified": "2025-11-27 16:46:30.210628",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt",
|
"name": "Purchase Receipt",
|
||||||
@@ -1380,4 +1381,3 @@
|
|||||||
"title_field": "title",
|
"title_field": "title",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user