mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
fix: reposting fixes for transaction based and parallel reposting
This commit is contained in:
@@ -290,6 +290,7 @@ class RepostItemValuation(Document):
|
|||||||
"""Deduplicate similar reposts based on item-warehouse-posting combination."""
|
"""Deduplicate similar reposts based on item-warehouse-posting combination."""
|
||||||
|
|
||||||
if self.repost_only_accounting_ledgers:
|
if self.repost_only_accounting_ledgers:
|
||||||
|
# If against same voucher there are multiple RIVs for accounting ledgers only, skip them
|
||||||
self.skipped_similar_reposts()
|
self.skipped_similar_reposts()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -559,25 +560,13 @@ def run_parallel_reposting():
|
|||||||
frappe.db.get_single_value("Stock Reposting Settings", "no_of_parallel_reposting") or 4
|
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:
|
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)
|
execute_reposting_entry(row.name)
|
||||||
continue
|
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:
|
if row.item_code in items:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -623,7 +612,7 @@ def execute_reposting_entry(name):
|
|||||||
doc.deduplicate_similar_repost()
|
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")
|
doctype = frappe.qb.DocType("Repost Item Valuation")
|
||||||
|
|
||||||
query = (
|
query = (
|
||||||
@@ -639,9 +628,6 @@ def get_repost_item_valuation_entries(based_on=None):
|
|||||||
.orderby(doctype.status, order=frappe.qb.asc)
|
.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)
|
return query.run(as_dict=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "4",
|
"default": "4",
|
||||||
|
"depends_on": "eval: doc.item_based_reposting === 1 && doc.enable_parallel_reposting === 1",
|
||||||
"fieldname": "no_of_parallel_reposting",
|
"fieldname": "no_of_parallel_reposting",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "No of Parallel Reposting (Per Item)"
|
"label": "No of Parallel Reposting (Per Item)"
|
||||||
@@ -85,7 +86,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-12-10 17:45:56.597514",
|
"modified": "2026-01-05 16:16:26.548349",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Reposting Settings",
|
"name": "Stock Reposting Settings",
|
||||||
|
|||||||
Reference in New Issue
Block a user