Merge pull request #49686 from frappe/mergify/bp/version-15-hotfix/pr-49676

fix: auto commit if too many writes reached (backport #49676)
This commit is contained in:
Diptanil Saha
2025-09-23 11:20:36 +05:30
committed by GitHub

View File

@@ -6,7 +6,10 @@ def execute():
"POS Invoice Merge Log", {"docstatus": 1}, ["name", "pos_closing_entry"]
)
frappe.db.auto_commit_on_many_writes = 1
for log in pos_invoice_merge_logs:
if log.pos_closing_entry and frappe.db.exists("POS Closing Entry", log.pos_closing_entry):
company = frappe.db.get_value("POS Closing Entry", log.pos_closing_entry, "company")
frappe.db.set_value("POS Invoice Merge Log", log.name, "company", company)
frappe.db.auto_commit_on_many_writes = 0