mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
fix: Account filter not working with accounting dimension filter
This commit is contained in:
@@ -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', 'Company') :
|
'Cost Center', 'Accounting Dimension Detail', 'Company', 'Account') :
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ def get_gl_entries(filters, accounting_dimensions):
|
|||||||
dimension_fields=dimension_fields, select_fields=select_fields, conditions=get_conditions(filters), distributed_cost_center_query=distributed_cost_center_query,
|
dimension_fields=dimension_fields, select_fields=select_fields, conditions=get_conditions(filters), distributed_cost_center_query=distributed_cost_center_query,
|
||||||
order_by_statement=order_by_statement
|
order_by_statement=order_by_statement
|
||||||
),
|
),
|
||||||
filters, as_dict=1)
|
filters, as_dict=1, debug=1)
|
||||||
|
|
||||||
if filters.get('presentation_currency'):
|
if filters.get('presentation_currency'):
|
||||||
return convert_to_presentation_currency(gl_entries, currency_map, filters.get('company'))
|
return convert_to_presentation_currency(gl_entries, currency_map, filters.get('company'))
|
||||||
@@ -222,7 +222,7 @@ def get_gl_entries(filters, accounting_dimensions):
|
|||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = []
|
conditions = []
|
||||||
|
|
||||||
if filters.get("account") and not filters.get("include_dimensions"):
|
if filters.get("account"):
|
||||||
filters.account = get_accounts_with_children(filters.account)
|
filters.account = get_accounts_with_children(filters.account)
|
||||||
conditions.append("account in %(account)s")
|
conditions.append("account in %(account)s")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user