Merge pull request #23755 from deepeshgarg007/accounting_dimension_gl_fix_v13
fix: Do not allow Company as accounting dimension
This commit is contained in:
commit
2004f64bcd
@ -7,7 +7,7 @@ frappe.ui.form.on('Accounting Dimension', {
|
|||||||
frm.set_query('document_type', () => {
|
frm.set_query('document_type', () => {
|
||||||
let invalid_doctypes = frappe.model.core_doctypes_list;
|
let invalid_doctypes = frappe.model.core_doctypes_list;
|
||||||
invalid_doctypes.push('Accounting Dimension', 'Project',
|
invalid_doctypes.push('Accounting Dimension', 'Project',
|
||||||
'Cost Center', 'Accounting Dimension Detail');
|
'Cost Center', 'Accounting Dimension Detail', 'Company');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
|
@ -19,7 +19,7 @@ class AccountingDimension(Document):
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.document_type in core_doctypes_list + ('Accounting Dimension', 'Project',
|
if self.document_type in core_doctypes_list + ('Accounting Dimension', 'Project',
|
||||||
'Cost Center', 'Accounting Dimension Detail') :
|
'Cost Center', 'Accounting Dimension Detail', 'Company') :
|
||||||
|
|
||||||
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
|
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
|
||||||
frappe.throw(msg)
|
frappe.throw(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user