Skip to content

Commit

Permalink
fix: validate accounting dimension company in journal entry and stock…
Browse files Browse the repository at this point in the history
… entry
  • Loading branch information
Bhavan23 committed Feb 28, 2025
1 parent 453bcd7 commit 4f8e13c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def validate(self):
self.validate_empty_accounts_table()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
self.validate_company_in_accounting_dimension()
self.validate_advance_accounts()

if self.docstatus == 0:
Expand Down
2 changes: 1 addition & 1 deletion erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def validate_company_in_accounting_dimension(self):
.where(doc_field.fieldname == "company")
).run(as_list=True)

dimension_list = sum(dimension_list, ["Project"])
dimension_list = sum(dimension_list, ["Project", "Cost Center"])
self.validate_company(dimension_list)

for child in self.get_all_children() or []:
Expand Down
1 change: 1 addition & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def validate(self):
self.validate_bom()
self.set_process_loss_qty()
self.validate_purchase_order()
self.validate_company_in_accounting_dimension()

if self.purpose in ("Manufacture", "Repack"):
self.mark_finished_and_scrap_items()
Expand Down

0 comments on commit 4f8e13c

Please sign in to comment.