refactor!: drop deprecated and dead code
This commit is contained in:
parent
c371b52d27
commit
1553fa9c90
@ -20,18 +20,6 @@ class Bin(Document):
|
||||
+ flt(self.indented_qty) + flt(self.planned_qty) - flt(self.reserved_qty)
|
||||
- flt(self.reserved_qty_for_production) - flt(self.reserved_qty_for_sub_contract))
|
||||
|
||||
def get_first_sle(self):
|
||||
sle = frappe.qb.DocType("Stock Ledger Entry")
|
||||
first_sle = (
|
||||
frappe.qb.from_(sle)
|
||||
.select("*")
|
||||
.where((sle.item_code == self.item_code) & (sle.warehouse == self.warehouse))
|
||||
.orderby(sle.posting_date, sle.posting_time, sle.creation)
|
||||
.limit(1)
|
||||
).run(as_dict=True)
|
||||
|
||||
return first_sle and first_sle[0] or None
|
||||
|
||||
def update_reserved_qty_for_production(self):
|
||||
'''Update qty reserved for production from Production Item tables
|
||||
in open work orders'''
|
||||
@ -107,13 +95,6 @@ def on_doctype_update():
|
||||
frappe.db.add_unique("Bin", ["item_code", "warehouse"], constraint_name="unique_item_warehouse")
|
||||
|
||||
|
||||
def update_stock(bin_name, args, allow_negative_stock=False, via_landed_cost_voucher=False):
|
||||
"""WARNING: This function is deprecated. Inline this function instead of using it."""
|
||||
from erpnext.stock.stock_ledger import repost_current_voucher
|
||||
|
||||
repost_current_voucher(args, allow_negative_stock, via_landed_cost_voucher)
|
||||
update_qty(bin_name, args)
|
||||
|
||||
def get_bin_details(bin_name):
|
||||
return frappe.db.get_value('Bin', bin_name, ['actual_qty', 'ordered_qty',
|
||||
'reserved_qty', 'indented_qty', 'planned_qty', 'reserved_qty_for_production',
|
||||
|
@ -6,7 +6,6 @@ import frappe
|
||||
from frappe.utils import cstr, flt, nowdate, nowtime
|
||||
|
||||
from erpnext.controllers.stock_controller import create_repost_item_valuation_entry
|
||||
from erpnext.stock.utils import update_bin
|
||||
|
||||
|
||||
def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False, only_bin=False):
|
||||
@ -227,8 +226,6 @@ def set_stock_balance_as_per_serial_no(item_code=None, posting_date=None, postin
|
||||
"sle_id": sle_doc.name
|
||||
})
|
||||
|
||||
update_bin(args)
|
||||
|
||||
create_repost_item_valuation_entry({
|
||||
"item_code": d[0],
|
||||
"warehouse": d[1],
|
||||
|
@ -206,16 +206,6 @@ def _create_bin(item_code, warehouse):
|
||||
|
||||
return bin_obj
|
||||
|
||||
def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False):
|
||||
"""WARNING: This function is deprecated. Inline this function instead of using it."""
|
||||
from erpnext.stock.doctype.bin.bin import update_stock
|
||||
is_stock_item = frappe.get_cached_value('Item', args.get("item_code"), 'is_stock_item')
|
||||
if is_stock_item:
|
||||
bin_name = get_or_make_bin(args.get("item_code"), args.get("warehouse"))
|
||||
update_stock(bin_name, args, allow_negative_stock, via_landed_cost_voucher)
|
||||
else:
|
||||
frappe.msgprint(_("Item {0} ignored since it is not a stock item").format(args.get("item_code")))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_incoming_rate(args, raise_error_if_no_rate=True):
|
||||
"""Get Incoming Rate based on valuation method"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user