fix: Set query fix
This commit is contained in:
parent
b124aff0bb
commit
41a1cd954c
@ -4,19 +4,19 @@
|
|||||||
frappe.ui.form.on('Accounting Dimension', {
|
frappe.ui.form.on('Accounting Dimension', {
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
frm.set_query('document_type', () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
name: ['not in', ['Accounting Dimension', 'Project', 'Cost Center', 'Accounting Dimension Detail']]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
if (!frm.is_new()) {
|
if (!frm.is_new()) {
|
||||||
frm.add_custom_button(__('Show {0}', [frm.doc.document_type]), function () {
|
frm.add_custom_button(__('Show {0}', [frm.doc.document_type]), function () {
|
||||||
frappe.set_route("List", frm.doc.document_type);
|
frappe.set_route("List", frm.doc.document_type);
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_query('document_type', () => {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
name: ['not in', ['Accounting Dimension', 'Project', 'Cost Center']]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
let button = frm.doc.disabled ? "Enable" : "Disable";
|
let button = frm.doc.disabled ? "Enable" : "Disable";
|
||||||
|
|
||||||
frm.add_custom_button(__(button), function() {
|
frm.add_custom_button(__(button), function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user