refactor: replace misleading variable name
This commit is contained in:
parent
c339240250
commit
97060c45e9
@ -803,9 +803,9 @@ class update_entries_after(object):
|
|||||||
def update_bin(self):
|
def update_bin(self):
|
||||||
# update bin for each warehouse
|
# update bin for each warehouse
|
||||||
for warehouse, data in self.data.items():
|
for warehouse, data in self.data.items():
|
||||||
bin_record = get_or_make_bin(self.item_code, warehouse)
|
bin_name = get_or_make_bin(self.item_code, warehouse)
|
||||||
|
|
||||||
frappe.db.set_value('Bin', bin_record, {
|
frappe.db.set_value('Bin', bin_name, {
|
||||||
"valuation_rate": data.valuation_rate,
|
"valuation_rate": data.valuation_rate,
|
||||||
"actual_qty": data.qty_after_transaction,
|
"actual_qty": data.qty_after_transaction,
|
||||||
"stock_value": data.stock_value
|
"stock_value": data.stock_value
|
||||||
|
@ -187,7 +187,7 @@ def get_bin(item_code, warehouse):
|
|||||||
bin_obj.flags.ignore_permissions = True
|
bin_obj.flags.ignore_permissions = True
|
||||||
return bin_obj
|
return bin_obj
|
||||||
|
|
||||||
def get_or_make_bin(item_code, warehouse) -> str:
|
def get_or_make_bin(item_code: str , warehouse: str) -> str:
|
||||||
bin_record = frappe.db.get_value('Bin', {'item_code': item_code, 'warehouse': warehouse})
|
bin_record = frappe.db.get_value('Bin', {'item_code': item_code, 'warehouse': warehouse})
|
||||||
|
|
||||||
if not bin_record:
|
if not bin_record:
|
||||||
@ -206,8 +206,8 @@ def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False):
|
|||||||
from erpnext.stock.doctype.bin.bin import update_stock
|
from erpnext.stock.doctype.bin.bin import update_stock
|
||||||
is_stock_item = frappe.get_cached_value('Item', args.get("item_code"), 'is_stock_item')
|
is_stock_item = frappe.get_cached_value('Item', args.get("item_code"), 'is_stock_item')
|
||||||
if is_stock_item:
|
if is_stock_item:
|
||||||
bin_record = get_or_make_bin(args.get("item_code"), args.get("warehouse"))
|
bin_name = get_or_make_bin(args.get("item_code"), args.get("warehouse"))
|
||||||
update_stock(bin_record, args, allow_negative_stock, via_landed_cost_voucher)
|
update_stock(bin_name, args, allow_negative_stock, via_landed_cost_voucher)
|
||||||
else:
|
else:
|
||||||
frappe.msgprint(_("Item {0} ignored since it is not a stock item").format(args.get("item_code")))
|
frappe.msgprint(_("Item {0} ignored since it is not a stock item").format(args.get("item_code")))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user