Skip to content

Commit

Permalink
fix: fetch accounting dimension details specific to company
Browse files Browse the repository at this point in the history
(cherry picked from commit 4e09de4)
  • Loading branch information
GursheenK authored and mergify[bot] committed Aug 18, 2023
1 parent 3198f26 commit c1f1a21
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,11 @@ def make_acc_dimensions_offsetting_entry(self, gl_map, d):
for dimension in accounting_dimensions:
dimension_details = frappe.db.get_values(
"Accounting Dimension Detail",
{"parent": dimension},
{"parent": dimension, "company": self.company},
["automatically_post_balancing_accounting_entry", "offsetting_account"],
)[0]
if dimension_details[0] == 1:
)
dimension_details = dimension_details[0] if len(dimension_details) > 0 else None
if dimension_details and dimension_details[0] == 1:
offsetting_account = dimension_details[1]
gl_map.append(
self.get_gl_dict(
Expand All @@ -947,9 +948,7 @@ def make_acc_dimensions_offsetting_entry(self, gl_map, d):
),
"against_voucher_type": d.reference_type,
"against_voucher": d.reference_name,
"remarks": _(
"Offsetting for Accounting Dimension - {dimension}".format(dimension=dimension)
),
"remarks": _("Offsetting for Accounting Dimension") + " - {0}".format(dimension),
"voucher_detail_no": d.reference_detail_no,
"cost_center": d.cost_center,
"project": d.project,
Expand Down

0 comments on commit c1f1a21

Please sign in to comment.