mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 21:59:13 +00:00
Fixes in repost_stock utility
This commit is contained in:
@@ -22,7 +22,7 @@ def repost(allow_negative_stock=False):
|
|||||||
(select item_code, warehouse from tabBin
|
(select item_code, warehouse from tabBin
|
||||||
union
|
union
|
||||||
select item_code, warehouse from `tabStock Ledger Entry`) a"""):
|
select item_code, warehouse from `tabStock Ledger Entry`) a"""):
|
||||||
repost_stock(d[0], d[1], allow_negative_stock)
|
repost_stock(d[0], d[1])
|
||||||
|
|
||||||
if allow_negative_stock:
|
if allow_negative_stock:
|
||||||
frappe.db.set_default("allow_negative_stock",
|
frappe.db.set_default("allow_negative_stock",
|
||||||
@@ -33,7 +33,7 @@ def repost_stock(item_code, warehouse):
|
|||||||
repost_actual_qty(item_code, warehouse)
|
repost_actual_qty(item_code, warehouse)
|
||||||
|
|
||||||
if item_code and warehouse:
|
if item_code and warehouse:
|
||||||
update_bin(item_code, warehouse, {
|
update_bin_qty(item_code, warehouse, {
|
||||||
"reserved_qty": get_reserved_qty(item_code, warehouse),
|
"reserved_qty": get_reserved_qty(item_code, warehouse),
|
||||||
"indented_qty": get_indented_qty(item_code, warehouse),
|
"indented_qty": get_indented_qty(item_code, warehouse),
|
||||||
"ordered_qty": get_ordered_qty(item_code, warehouse),
|
"ordered_qty": get_ordered_qty(item_code, warehouse),
|
||||||
@@ -116,7 +116,7 @@ def get_planned_qty(item_code, warehouse):
|
|||||||
return flt(planned_qty[0][0]) if planned_qty else 0
|
return flt(planned_qty[0][0]) if planned_qty else 0
|
||||||
|
|
||||||
|
|
||||||
def update_bin(item_code, warehouse, qty_dict=None):
|
def update_bin_qty(item_code, warehouse, qty_dict=None):
|
||||||
from erpnext.stock.utils import get_bin
|
from erpnext.stock.utils import get_bin
|
||||||
bin = get_bin(item_code, warehouse)
|
bin = get_bin(item_code, warehouse)
|
||||||
mismatch = False
|
mismatch = False
|
||||||
|
|||||||
Reference in New Issue
Block a user