fix: hide ledger button on new warehouse
This commit is contained in:
parent
2e13fbab5e
commit
7a18db561f
@ -39,26 +39,28 @@ frappe.ui.form.on("Warehouse", {
|
|||||||
!frm.doc.__islocal
|
!frm.doc.__islocal
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!frm.doc.__islocal) {
|
if (!frm.is_new()) {
|
||||||
frappe.contacts.render_address_and_contact(frm);
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
|
|
||||||
|
frm.add_custom_button(__("Stock Balance"), function () {
|
||||||
|
frappe.set_route("query-report", "Stock Balance", {
|
||||||
|
warehouse: frm.doc.name,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
frm.add_custom_button(
|
||||||
|
frm.doc.is_group
|
||||||
|
? __("Convert to Ledger", null, "Warehouse")
|
||||||
|
: __("Convert to Group", null, "Warehouse"),
|
||||||
|
function () {
|
||||||
|
convert_to_group_or_ledger(frm);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
frappe.contacts.clear_address_and_contact(frm);
|
frappe.contacts.clear_address_and_contact(frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
frm.add_custom_button(__("Stock Balance"), function () {
|
|
||||||
frappe.set_route("query-report", "Stock Balance", {
|
|
||||||
warehouse: frm.doc.name,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
frm.add_custom_button(
|
|
||||||
frm.doc.is_group
|
|
||||||
? __("Convert to Ledger", null, "Warehouse")
|
|
||||||
: __("Convert to Group", null, "Warehouse"),
|
|
||||||
function () {
|
|
||||||
convert_to_group_or_ledger(frm);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!frm.doc.is_group && frm.doc.__onload && frm.doc.__onload.account) {
|
if (!frm.doc.is_group && frm.doc.__onload && frm.doc.__onload.account) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user