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.

(cherry picked from commit 45dd46be3d)
This commit is contained in:
Ankush Menat
2021-11-02 10:50:52 +05:30
committed by mergify-bot
parent db22859b54
commit 7ae5bc8911
2 changed files with 16 additions and 3 deletions

View File

@@ -544,7 +544,12 @@ class StockController(AccountsController):
"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):