From 6e438e71ebcb6933d3af659a8234a772e4bd5fe2 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 9 Apr 2026 12:47:36 +0530 Subject: [PATCH 1/2] fix: set default posting time in RIV (cherry picked from commit a7ece65536d54c03a615ba43b5f23e4643492d6b) # Conflicts: # erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py --- .../repost_item_valuation.py | 19 +++++++++++++++++++ erpnext/stock/stock_ledger.py | 2 ++ 2 files changed, 21 insertions(+) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 44cf9280780..96e49b288cc 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -74,6 +74,11 @@ class RepostItemValuation(Document): repost(self) def validate(self): +<<<<<<< HEAD +======= + self.set_default_posting_time() + self.reset_repost_only_accounting_ledgers() +>>>>>>> a7ece65536 (fix: set default posting time in RIV) self.set_company() self.validate_update_stock() self.validate_period_closing_voucher() @@ -83,6 +88,20 @@ class RepostItemValuation(Document): self.reset_recreate_stock_ledgers() self.validate_recreate_stock_ledgers() +<<<<<<< HEAD +======= + def set_default_posting_time(self): + if not self.posting_time: + self.posting_time = nowtime() + + if not self.posting_date: + frappe.throw(_("Posting date is required")) + + def reset_repost_only_accounting_ledgers(self): + if self.repost_only_accounting_ledgers and self.based_on != "Transaction": + self.repost_only_accounting_ledgers = 0 + +>>>>>>> a7ece65536 (fix: set default posting time in RIV) def validate_update_stock(self): if self.voucher_type in ["Sales Invoice", "Purchase Invoice"]: update_stock = frappe.get_value(self.voucher_type, self.voucher_no, "update_stock") diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 3e5974e0f53..18e06fd6c10 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -233,6 +233,8 @@ def repost_future_sle( index = get_current_index(doc) or 0 while index < len(items_to_be_repost): + validate_item_warehouse(items_to_be_repost[index]) + obj = update_entries_after( { "item_code": items_to_be_repost[index].get("item_code"), From 2df574baae31be34951b8deda8149fd3ca801ff2 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 9 Apr 2026 14:24:07 +0530 Subject: [PATCH 2/2] chore: fix conflicts Removed unused method reset_repost_only_accounting_ledgers and fixed the validate method to set default posting time. --- .../repost_item_valuation/repost_item_valuation.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 96e49b288cc..bfc857ed80b 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -74,11 +74,7 @@ class RepostItemValuation(Document): repost(self) def validate(self): -<<<<<<< HEAD -======= self.set_default_posting_time() - self.reset_repost_only_accounting_ledgers() ->>>>>>> a7ece65536 (fix: set default posting time in RIV) self.set_company() self.validate_update_stock() self.validate_period_closing_voucher() @@ -88,8 +84,6 @@ class RepostItemValuation(Document): self.reset_recreate_stock_ledgers() self.validate_recreate_stock_ledgers() -<<<<<<< HEAD -======= def set_default_posting_time(self): if not self.posting_time: self.posting_time = nowtime() @@ -97,11 +91,6 @@ class RepostItemValuation(Document): if not self.posting_date: frappe.throw(_("Posting date is required")) - def reset_repost_only_accounting_ledgers(self): - if self.repost_only_accounting_ledgers and self.based_on != "Transaction": - self.repost_only_accounting_ledgers = 0 - ->>>>>>> a7ece65536 (fix: set default posting time in RIV) def validate_update_stock(self): if self.voucher_type in ["Sales Invoice", "Purchase Invoice"]: update_stock = frappe.get_value(self.voucher_type, self.voucher_no, "update_stock")