From c7dbedbfdcc7482ce1704f536fc409c8e07389bd Mon Sep 17 00:00:00 2001 From: pandiyan Date: Wed, 17 Jun 2026 18:01:14 +0530 Subject: [PATCH] fix: disable is_debit_note while creating credit note (cherry picked from commit 279c8dea0630215553bacdd2792f97a7725ac36b) --- erpnext/controllers/sales_and_purchase_return.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 51affeade12..e1e06b287f0 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -445,6 +445,8 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None, return_agai doc.pricing_rules = [] doc.return_against = source.name doc.set_warehouse = "" + if doctype == "Sales Invoice": + doc.is_debit_note = 0 if doctype == "Sales Invoice" or doctype == "POS Invoice": doc.is_pos = source.is_pos