From e730b8c6e4e38d241f522108519767e4db4cc048 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 25 Mar 2024 16:11:10 +0100 Subject: [PATCH] fix(return): set default return warehouse This captures the case of manual modifications to the return and ensures that by default, the correct return warehouse will be set (cherry picked from commit fa65291e9877464aa650371c21c9a355f91483c3) --- erpnext/controllers/sales_and_purchase_return.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 3755506b6f5..8e80b15e972 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -335,6 +335,9 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None, return_agai doc.select_print_heading = frappe.get_cached_value("Print Heading", _("Debit Note")) if source.tax_withholding_category: doc.set_onload("supplier_tds", source.tax_withholding_category) + elif doctype == "Delivery Note": + # manual additions to the return should hit the return warehous, too + doc.set_warehouse = default_warehouse_for_sales_return for tax in doc.get("taxes") or []: if tax.charge_type == "Actual":