From 65992304bc259a44c60198b3b6e3be0f5b107b3e Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 4 Oct 2022 16:17:56 +0530 Subject: [PATCH] fix: delete old ple's on item value repost --- erpnext/accounts/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 95ba3d86ce..02dcd683fa 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1171,6 +1171,10 @@ def _delete_gl_entries(voucher_type, voucher_no): where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no), ) + ple = qb.DocType("Payment Ledger Entry") + qb.from_(ple).delete().where( + (ple.voucher_type == voucher_type) & (ple.voucher_no == voucher_no) + ).run() def sort_stock_vouchers_by_posting_date(