mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 19:55:29 +00:00
fix: skip validate_stock_accounts when perpetual inventory is disabled
When perpetual inventory is disabled, stock transactions produce no GL entries, so blocking manual Journal Entries against stock accounts is incorrect. Added an early return guard in validate_stock_accounts() to skip the check when is_perpetual_inventory_enabled() returns False.
This commit is contained in:
@@ -269,6 +269,9 @@ class JournalEntry(AccountsController):
|
||||
frappe.throw(_("Journal Entry type should be set as Depreciation Entry for asset depreciation"))
|
||||
|
||||
def validate_stock_accounts(self):
|
||||
if not erpnext.is_perpetual_inventory_enabled(self.company):
|
||||
return
|
||||
|
||||
stock_accounts = get_stock_accounts(self.company, accounts=self.accounts)
|
||||
for account in stock_accounts:
|
||||
account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(
|
||||
|
||||
Reference in New Issue
Block a user