Skip to content

fix: increase DB write limit before Loan Repayment Repost submission (backport #1260)#1262

Merged
Nihantra-Patel merged 2 commits into
version-2-betafrom
mergify/bp/version-2-beta/pr-1260
Jun 7, 2026
Merged

fix: increase DB write limit before Loan Repayment Repost submission (backport #1260)#1262
Nihantra-Patel merged 2 commits into
version-2-betafrom
mergify/bp/version-2-beta/pr-1260

Conversation

@mergify

@mergify mergify Bot commented Jun 7, 2026

Copy link
Copy Markdown

Issue

When a Loan Repayment Repost is submitted via Data Import for a loan with a
long history (e.g. repost from 2 years back), the submission fails with:

frappe.exceptions.TooManyWritesError

This happens because the repost cancels and recreates a large number of
accruals, demands, and GL entries in a single transaction, enough to
cross Frappe's default 200,000 write limit.

image

Fix

Multiply frappe.db.MAX_WRITES_PER_TRANSACTION by 4 at the start of
on_submit, raising the ceiling to 800,000 for the duration of the
repost.

This is the same approach used in ERPNext for Repost Item Valuation


This is an automatic backport of pull request #1260 done by [Mergify](https://mergify.com).

@mergify mergify Bot requested a review from deepeshgarg007 as a code owner June 7, 2026 10:45
@Nihantra-Patel Nihantra-Patel merged commit f510578 into version-2-beta Jun 7, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant