mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
fix: skip validate_stock_accounts in Journal Entry when perpetual inventory is disabled (backport #53554) (backport #53558) (#54104)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Saeed Kola <mohammedsaeedk@gmail.com> Co-authored-by: diptanilsaha <diptanil@frappe.io>
This commit is contained in:
@@ -354,8 +354,11 @@ class JournalEntry(AccountsController):
|
|||||||
frappe.throw(_("Account {0} should be of type Expense").format(d.account))
|
frappe.throw(_("Account {0} should be of type Expense").format(d.account))
|
||||||
|
|
||||||
def validate_stock_accounts(self):
|
def validate_stock_accounts(self):
|
||||||
if self.voucher_type == "Periodic Accounting Entry":
|
if (
|
||||||
# Skip validation for periodic accounting entry
|
not erpnext.is_perpetual_inventory_enabled(self.company)
|
||||||
|
or self.voucher_type == "Periodic Accounting Entry"
|
||||||
|
):
|
||||||
|
# Skip validation for periodic accounting entry and Perpetual Inventory Disabled Company.
|
||||||
return
|
return
|
||||||
|
|
||||||
stock_accounts = get_stock_accounts(self.company, accounts=self.accounts)
|
stock_accounts = get_stock_accounts(self.company, accounts=self.accounts)
|
||||||
|
|||||||
Reference in New Issue
Block a user