engine = env["taqnix.acc.engine"] # Close Status is an Accounting Pro report: same engine, same access rights
# the Close Status of the months of a fiscal year: status, progress, tasks done, open mandatory tasks, failed checks, who closed it, lock date
options = {"date": {"preset": "custom", "from": "2026-01-01", "to": "2026-12-31"}, "extra": {"kind": "month", "details": False}}
table = engine.get_table("closing_status", options)
for row in table["rows"]:
print(row["type"], [cell.get("text") for cell in row["cells"]][:7]) # ['October 2026', 'Month', 'In review', '33.3 %', '4 / 12', '6', '4']
# the periods under review and their failing automatic checks
for period in env["taqnix.accc.period"].search([("state", "in", ("in_review", "reopened"))]):
failing = period.task_ids.filtered(lambda t: t.kind == "automatic" and t.checked_on and not t.check_passed)
print(period.display_name, period.progress, [(t.name, t.check_message) for t in failing]) # October 2026 33.3 [('Post or delete the draft journal entries', '3 to fix'), ...]
# in SQL the closing flag is empty on ordinary entries: test IS NOT TRUE, never = FALSE
env.cr.execute("SELECT count(*) FROM account_move WHERE accc_is_closing IS NOT TRUE")
print(env.cr.fetchone()[0])