2020-03-26 14:49:28 +05:30
|
|
|
import frappe
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2020-03-26 14:49:28 +05:30
|
|
|
from erpnext.stock.stock_balance import get_indented_qty, update_bin_qty
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2020-03-26 14:49:28 +05:30
|
|
|
|
|
|
|
def execute():
|
|
|
|
bin_details = frappe.db.sql("""
|
|
|
|
SELECT item_code, warehouse
|
|
|
|
FROM `tabBin`""",as_dict=1)
|
|
|
|
|
|
|
|
for entry in bin_details:
|
2022-02-17 19:25:00 +05:30
|
|
|
if not (entry.item_code and entry.warehouse):
|
|
|
|
continue
|
2020-03-26 14:49:28 +05:30
|
|
|
update_bin_qty(entry.get("item_code"), entry.get("warehouse"), {
|
|
|
|
"indented_qty": get_indented_qty(entry.get("item_code"), entry.get("warehouse"))
|
|
|
|
})
|