mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
fix: do not hide primary-action for composite asset
(cherry picked from commit 482efee6c0)
# Conflicts:
# erpnext/assets/doctype/asset/asset.json
This commit is contained in:
@@ -80,6 +80,12 @@ frappe.ui.form.on("Asset", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
before_submit: function (frm) {
|
||||||
|
if (frm.doc.is_composite_asset && !frm.has_active_capitalization) {
|
||||||
|
frappe.throw(__("Please capitalize this asset before submitting."));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frappe.ui.form.trigger("Asset", "is_existing_asset");
|
frappe.ui.form.trigger("Asset", "is_existing_asset");
|
||||||
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
|
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
|
||||||
@@ -201,8 +207,7 @@ frappe.ui.form.on("Asset", {
|
|||||||
},
|
},
|
||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
if (!r.message) {
|
if (!r.message) {
|
||||||
$(".primary-action").prop("hidden", true);
|
$(".form-message").text(__("Capitalize this asset before submitting."));
|
||||||
$(".form-message").text(__("Capitalize this asset to confirm"));
|
|
||||||
|
|
||||||
frm.add_custom_button(__("Capitalize Asset"), function () {
|
frm.add_custom_button(__("Capitalize Asset"), function () {
|
||||||
frm.trigger("create_asset_capitalization");
|
frm.trigger("create_asset_capitalization");
|
||||||
@@ -542,7 +547,6 @@ frappe.ui.form.on("Asset", {
|
|||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
var doclist = frappe.model.sync(r.message);
|
var doclist = frappe.model.sync(r.message);
|
||||||
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
||||||
$(".primary-action").prop("hidden", false);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -551,8 +551,58 @@
|
|||||||
"fieldname": "purchase_invoice_item",
|
"fieldname": "purchase_invoice_item",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
|
<<<<<<< HEAD
|
||||||
"label": "Purchase Invoice Item",
|
"label": "Purchase Invoice Item",
|
||||||
"options": "Purchase Invoice Item"
|
"options": "Purchase Invoice Item"
|
||||||
|
=======
|
||||||
|
"label": "Purchase Invoice Item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "insurance_details_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Insurance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "other_info_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Other Info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "connections_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Connections",
|
||||||
|
"show_dashboard": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "depreciation_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Depreciation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "accounting_dimensions_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Accounting Dimensions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_jtou",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Additional Info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"depends_on": "eval:(!doc.is_existing_asset && !doc.is_composite_asset)",
|
||||||
|
"fieldname": "is_composite_component",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Is Composite Component"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "net_purchase_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"label": "Net Purchase Amount",
|
||||||
|
"mandatory_depends_on": "eval:(!doc.is_composite_asset || doc.docstatus==1)",
|
||||||
|
"options": "Company:company:default_currency",
|
||||||
|
"read_only_depends_on": "eval: doc.is_composite_asset"
|
||||||
|
>>>>>>> 482efee6c0 (fix: do not hide primary-action for composite asset)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 72,
|
"idx": 72,
|
||||||
@@ -596,7 +646,11 @@
|
|||||||
"link_fieldname": "target_asset"
|
"link_fieldname": "target_asset"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2025-11-17 18:01:51.417942",
|
"modified": "2025-11-17 18:01:51.417942",
|
||||||
|
=======
|
||||||
|
"modified": "2025-12-18 16:36:40.904246",
|
||||||
|
>>>>>>> 482efee6c0 (fix: do not hide primary-action for composite asset)
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
Reference in New Issue
Block a user