mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
* perf: Optimization for providional gl entries (cherry picked from commitd7b738ff61) # Conflicts: # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py * perf: Performance optimization for validating budget (cherry picked from commitf204d810bb) # Conflicts: # erpnext/accounts/doctype/budget/budget.py * perf: Cached accounting dimensions details (cherry picked from commit8cd8b8f885) * perf: Optimzed code for merging similar gl entries (cherry picked from commitaa75a60142) * fix: linter issues (cherry picked from commitacc0b2faf8) * perf: Cache accounting dimension filter map (cherry picked from commite4bd173875) # Conflicts: # erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py * fix: minor fixes (cherry picked from commit5cd9bf3bda) * perf: skip unnecessary validation while transaction cancellation (cherry picked from commit05385e4acb) * perf: refactored handling provisional gl entries for non-stock items (cherry picked from commit49c74369a5) # Conflicts: # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py * perf: validate expense against budget only if budget exists (cherry picked from commitc15b2d5490) * perf: Get bin details only for stock items (cherry picked from commit6ff9e6ee84) # Conflicts: # erpnext/stock/get_item_details.py * fix: added index for price_list column in Item Price (cherry picked from commitd279e23623) # Conflicts: # erpnext/stock/doctype/item_price/item_price.json * perf: Caching in checking allowance for qty and amount (cherry picked from commit8d682fa884) * perf: Caching in gl entry (cherry picked from commitb07769d8d7) # Conflicts: # erpnext/accounts/doctype/gl_entry/gl_entry.py * chore: resolve conflicts * chore: resolve conflict in purchase_invoice.py --------- Co-authored-by: Nabin Hait <nabinhait@gmail.com> Co-authored-by: ruthra kumar <ruthra@erpnext.com>
This commit is contained in:
@@ -1764,8 +1764,8 @@ class AccountsController(TransactionBase):
|
||||
item_allowance = {}
|
||||
global_qty_allowance, global_amount_allowance = None, None
|
||||
|
||||
role_allowed_to_over_bill = frappe.db.get_single_value(
|
||||
"Accounts Settings", "role_allowed_to_over_bill"
|
||||
role_allowed_to_over_bill = frappe.get_cached_value(
|
||||
"Accounts Settings", None, "role_allowed_to_over_bill"
|
||||
)
|
||||
user_roles = frappe.get_roles()
|
||||
|
||||
|
||||
@@ -554,6 +554,7 @@ class StatusUpdater(Document):
|
||||
ref_doc.set_status(update=True)
|
||||
|
||||
|
||||
@frappe.request_cache
|
||||
def get_allowance_for(
|
||||
item_code,
|
||||
item_allowance=None,
|
||||
@@ -583,20 +584,20 @@ def get_allowance_for(
|
||||
global_amount_allowance,
|
||||
)
|
||||
|
||||
qty_allowance, over_billing_allowance = frappe.db.get_value(
|
||||
qty_allowance, over_billing_allowance = frappe.get_cached_value(
|
||||
"Item", item_code, ["over_delivery_receipt_allowance", "over_billing_allowance"]
|
||||
)
|
||||
|
||||
if qty_or_amount == "qty" and not qty_allowance:
|
||||
if global_qty_allowance is None:
|
||||
global_qty_allowance = flt(
|
||||
frappe.db.get_single_value("Stock Settings", "over_delivery_receipt_allowance")
|
||||
frappe.get_cached_value("Stock Settings", None, "over_delivery_receipt_allowance")
|
||||
)
|
||||
qty_allowance = global_qty_allowance
|
||||
elif qty_or_amount == "amount" and not over_billing_allowance:
|
||||
if global_amount_allowance is None:
|
||||
global_amount_allowance = flt(
|
||||
frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
|
||||
frappe.get_cached_value("Accounts Settings", None, "over_billing_allowance")
|
||||
)
|
||||
over_billing_allowance = global_amount_allowance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user