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 c59ca0c2d6a..7be0b09169e 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -290,6 +290,7 @@ class RepostItemValuation(Document): """Deduplicate similar reposts based on item-warehouse-posting combination.""" if self.repost_only_accounting_ledgers: + # If against same voucher there are multiple RIVs for accounting ledgers only, skip them self.skipped_similar_reposts() return @@ -559,25 +560,13 @@ def run_parallel_reposting(): frappe.db.get_single_value("Stock Reposting Settings", "no_of_parallel_reposting") or 4 ) - riv_entries = get_repost_item_valuation_entries("Item and Warehouse") + riv_entries = get_repost_item_valuation_entries() for row in riv_entries: - if row.repost_only_accounting_ledgers: + if row.based_on != "Item and Warehouse" or row.repost_only_accounting_ledgers: execute_reposting_entry(row.name) continue - if frappe.db.get_value( - "Repost Item Valuation", - { - "based_on": "Item and Warehouse", - "item_code": row.item_code, - "docstatus": 1, - "status": "In Progress", - }, - "name", - ): - continue - if row.item_code in items: continue @@ -623,7 +612,7 @@ def execute_reposting_entry(name): doc.deduplicate_similar_repost() -def get_repost_item_valuation_entries(based_on=None): +def get_repost_item_valuation_entries(): doctype = frappe.qb.DocType("Repost Item Valuation") query = ( @@ -639,9 +628,6 @@ def get_repost_item_valuation_entries(based_on=None): .orderby(doctype.status, order=frappe.qb.asc) ) - if based_on: - query = query.where((doctype.based_on == based_on) | (doctype.repost_only_accounting_ledgers == 1)) - return query.run(as_dict=True) diff --git a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json index a06456e0c9c..fc0e14e7b95 100644 --- a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json +++ b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json @@ -77,6 +77,7 @@ }, { "default": "4", + "depends_on": "eval: doc.item_based_reposting === 1 && doc.enable_parallel_reposting === 1", "fieldname": "no_of_parallel_reposting", "fieldtype": "Int", "label": "No of Parallel Reposting (Per Item)" @@ -85,7 +86,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2025-12-10 17:45:56.597514", + "modified": "2026-01-05 16:16:26.548349", "modified_by": "Administrator", "module": "Stock", "name": "Stock Reposting Settings",