mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
[minor] close button for task and item not found error fix
This commit is contained in:
@@ -57,7 +57,12 @@ class StockLedgerEntry(Document):
|
||||
def validate_item(self):
|
||||
item_det = frappe.db.sql("""select name, has_batch_no, docstatus,
|
||||
is_stock_item, has_variants, stock_uom
|
||||
from tabItem where name=%s""", self.item_code, as_dict=True)[0]
|
||||
from tabItem where name=%s""", self.item_code, as_dict=True)
|
||||
|
||||
if not item_det:
|
||||
frappe.throw(_("Item {0} not found").format(self.item_code))
|
||||
|
||||
item_det = item_det[0]
|
||||
|
||||
if item_det.is_stock_item != 'Yes':
|
||||
frappe.throw(_("Item {0} must be a stock Item").format(self.item_code))
|
||||
@@ -97,7 +102,7 @@ class StockLedgerEntry(Document):
|
||||
def scrub_posting_time(self):
|
||||
if not self.posting_time or self.posting_time == '00:0':
|
||||
self.posting_time = '00:00'
|
||||
|
||||
|
||||
def validate_batch(self):
|
||||
if self.batch_no and self.voucher_type != "Stock Entry":
|
||||
expiry_date = frappe.db.get_value("Batch", self.batch_no, "expiry_date")
|
||||
|
||||
Reference in New Issue
Block a user