fix: validate pending reposting till acc frozen date

This commit is contained in:
khushi8112
2025-06-26 11:51:57 +05:30
parent 3a81e2c3c8
commit 93d281837a
2 changed files with 4 additions and 1 deletions

View File

@@ -162,6 +162,7 @@ class Company(NestedSet):
self.check_parent_changed()
self.set_chart_of_accounts()
self.validate_parent_company()
self.set_reporting_currency()
self.validate_pending_reposts(old_doc)
def validate_abbr(self):

View File

@@ -556,7 +556,7 @@ def is_reposting_item_valuation_in_progress():
)
def check_pending_reposting(posting_date: str, throw_error: bool = True) -> bool:
def check_pending_reposting(posting_date: str, company: str | None = None, throw_error: bool = True) -> bool:
"""Check if there are pending reposting job till the specified posting date."""
filters = {
@@ -564,6 +564,8 @@ def check_pending_reposting(posting_date: str, throw_error: bool = True) -> bool
"status": ["in", ["Queued", "In Progress"]],
"posting_date": ["<=", posting_date],
}
if company:
filters["company"] = company
reposting_pending = frappe.db.exists("Repost Item Valuation", filters)
if reposting_pending and throw_error: