feat: option to select reposting method
In current implementation selecting Item-Warehouse based reposting is
better for few users, who don't use depenent SLEs but have frequent
transactions involving same items.
This change lets them switch to item-warehouse based reposting if
required.
Only use this if you understand technicalities of stock reposting. This
is experimental but will become mainstream in coming days.
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index fe5d0c7..ca567fd 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -544,7 +544,12 @@
"company": self.company
})
if future_sle_exists(args):
- create_item_wise_repost_entries(voucher_type=self.doctype, voucher_no=self.name)
+ item_based_reposting = cint(frappe.db.get_single_value("Stock Reposting Settings", "item_based_reposting"))
+ if item_based_reposting:
+ create_item_wise_repost_entries(voucher_type=self.doctype, voucher_no=self.name)
+ else:
+ create_repost_item_valuation_entry(args)
+
@frappe.whitelist()
def make_quality_inspections(doctype, docname, items):