[Fix] View ledger button not disaplying in the head of an account (#10254)
* [Fix] View ledger button not disaplying in the head of an account * Show view ledger button in account if user has permission to read GL Entry data
This commit is contained in:
parent
1696294847
commit
5906ddf804
@ -68,7 +68,8 @@ frappe.ui.form.on('Account', {
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (cint(frm.doc.is_group) == 0) {
|
||||
} else if (cint(frm.doc.is_group) == 0
|
||||
&& frappe.boot.user.can_read.indexOf("GL Entry") !== -1) {
|
||||
cur_frm.add_custom_button(__('Ledger'), function () {
|
||||
frappe.route_options = {
|
||||
"account": frm.doc.name,
|
||||
|
@ -718,7 +718,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-04-27 13:18:06.617940",
|
||||
"modified": "2017-08-03 12:40:09.611951",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "GL Entry",
|
||||
@ -786,7 +786,7 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"search_fields": "voucher_no,account,posting_date,against_voucher",
|
||||
"show_name_in_global_search": 0,
|
||||
|
23
erpnext/accounts/doctype/gl_entry/test_gl_entry.js
Normal file
23
erpnext/accounts/doctype/gl_entry/test_gl_entry.js
Normal file
@ -0,0 +1,23 @@
|
||||
/* eslint-disable */
|
||||
// rename this file from _test_[name] to test_[name] to activate
|
||||
// and remove above this line
|
||||
|
||||
QUnit.test("test: GL Entry", function (assert) {
|
||||
let done = assert.async();
|
||||
|
||||
// number of asserts
|
||||
assert.expect(1);
|
||||
|
||||
frappe.run_serially('GL Entry', [
|
||||
// insert a new GL Entry
|
||||
() => frappe.tests.make([
|
||||
// values to be set
|
||||
{key: 'value'}
|
||||
]),
|
||||
() => {
|
||||
assert.equal(cur_frm.doc.key, 'value');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user