perf: process_gl_map causing performance issues in the reposting

This commit is contained in:
Rohit Waghchaure
2025-08-02 12:16:45 +05:30
parent 4488b27fe3
commit a96fa55704
4 changed files with 6 additions and 4 deletions

View File

@@ -638,7 +638,9 @@ class StockController(AccountsController):
).format(wh, self.company)
)
return process_gl_map(gl_list, precision=precision)
return process_gl_map(
gl_list, precision=precision, from_repost=frappe.flags.through_repost_item_valuation
)
def get_debit_field_precision(self):
if not frappe.flags.debit_field_precision:

View File

@@ -443,7 +443,7 @@ class PurchaseReceipt(BuyingController):
self.make_tax_gl_entries(gl_entries, via_landed_cost_voucher)
update_regional_gl_entries(gl_entries, self)
return process_gl_map(gl_entries)
return process_gl_map(gl_entries, from_repost=frappe.flags.through_repost_item_valuation)
def make_item_gl_entries(self, gl_entries, warehouse_account=None):
from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import (

View File

@@ -1612,7 +1612,7 @@ class StockEntry(StockController):
)
)
return process_gl_map(gl_entries)
return process_gl_map(gl_entries, from_repost=frappe.flags.through_repost_item_valuation)
def update_work_order(self):
def _validate_work_order(pro_doc):

View File

@@ -548,7 +548,7 @@ class SubcontractingReceipt(SubcontractingController):
gl_entries = []
self.make_item_gl_entries(gl_entries, warehouse_account)
return process_gl_map(gl_entries)
return process_gl_map(gl_entries, from_repost=frappe.flags.through_repost_item_valuation)
def make_item_gl_entries(self, gl_entries, warehouse_account=None):
warehouse_with_no_account = []