From 94605687c7ad133b36ef5856c5c69e8aed8840f3 Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:35:06 +0530 Subject: [PATCH 1/4] fix: handle flt conversion for prev_ordered_qty (cherry picked from commit 77c35ef47f186bcfec88a8db9795bcd4063edb71) --- erpnext/buying/doctype/purchase_order/purchase_order.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index a828c117edb..ff0778f3687 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -456,9 +456,8 @@ class PurchaseOrder(BuyingController): if not self.is_against_so(): return for item in removed_items: - prev_ordered_qty = ( + prev_ordered_qty = flt( frappe.get_cached_value("Sales Order Item", item.get("sales_order_item"), "ordered_qty") - or 0.0 ) frappe.db.set_value( From 85c509ea69636f6c252e00baf21a45535b0ac19f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 14 Oct 2025 11:48:42 +0530 Subject: [PATCH 2/4] fix: do reposting of first transfer entry based on item-wh combination (cherry picked from commit 2f25b445abdcdde3a9232ed7e8bbf91e3c8732f1) # Conflicts: # erpnext/stock/stock_ledger.py --- erpnext/stock/stock_ledger.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 8547432b876..406305bde14 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -496,7 +496,14 @@ class update_entries_after: elif dependant_sle.voucher_type == "Stock Entry" and is_transfer_stock_entry( dependant_sle.voucher_no ): +<<<<<<< HEAD print(dependant_sle.voucher_no) +======= + if self.distinct_item_warehouses[key].get("transfer_entry_to_repost"): + return + + val["transfer_entry_to_repost"] = True +>>>>>>> 2f25b445ab (fix: do reposting of first transfer entry based on item-wh combination) self.distinct_item_warehouses[key] = val self.new_items_found = True From 210786119dffca90396f6df2eaa706d6de1c53c4 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 16 Oct 2025 00:17:50 +0530 Subject: [PATCH 3/4] chore: fix conflicts --- erpnext/stock/stock_ledger.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 406305bde14..68c7c314091 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -496,14 +496,10 @@ class update_entries_after: elif dependant_sle.voucher_type == "Stock Entry" and is_transfer_stock_entry( dependant_sle.voucher_no ): -<<<<<<< HEAD - print(dependant_sle.voucher_no) -======= if self.distinct_item_warehouses[key].get("transfer_entry_to_repost"): return val["transfer_entry_to_repost"] = True ->>>>>>> 2f25b445ab (fix: do reposting of first transfer entry based on item-wh combination) self.distinct_item_warehouses[key] = val self.new_items_found = True From 00a75d49844e2d76447657d7fab0b4e4fda15348 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:59:31 +0200 Subject: [PATCH 4/4] refactor: simplify expression (backport #50168) (#50169) Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> --- erpnext/controllers/accounts_controller.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 77d4db8504f..8f151b56394 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2750,9 +2750,7 @@ def set_balance_in_account_currency( _("Account: {0} with currency: {1} can not be selected").format(gl_dict.account, account_currency) ) - gl_dict["account_currency"] = ( - company_currency if account_currency == company_currency else account_currency - ) + gl_dict["account_currency"] = account_currency # set debit/credit in account currency if not provided if flt(gl_dict.debit) and not flt(gl_dict.debit_in_account_currency):