From 9f51ee4a84b1d812a5dac2503608c5a5483fd21e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 24 Nov 2013 16:03:40 +0530 Subject: [PATCH] [fix] [minor] serial no status update fix --- stock/doctype/serial_no/serial_no.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stock/doctype/serial_no/serial_no.py b/stock/doctype/serial_no/serial_no.py index 8dfed0116c..e196f6c7ee 100644 --- a/stock/doctype/serial_no/serial_no.py +++ b/stock/doctype/serial_no/serial_no.py @@ -134,7 +134,7 @@ class DocType(StockController): entries = {} for sle in self.get_stock_ledger_entries(): - if self.doc.name in sle.serial_no.split("\n"): + if self.doc.name in get_serial_nos(sle.serial_no): if not entries.get("last_sle"): entries["last_sle"] = sle @@ -152,11 +152,8 @@ class DocType(StockController): def get_stock_ledger_entries(self): return webnotes.conn.sql("""select * from `tabStock Ledger Entry` - where (serial_no like %s or serial_no like %s or serial_no like %s or serial_no=%s) - and item_code=%s and ifnull(is_cancelled, 'No')='No' - order by name desc""", - ("%s%%" % (self.doc.name+"\n"), "%%%s%%" % ("\n"+self.doc.name+"\n"), - "%%%s" % ("\n"+self.doc.name), self.doc.name, self.doc.item_code), as_dict=1) + where serial_no like %s and item_code=%s and ifnull(is_cancelled, 'No')='No' + order by name desc""", ("%%%s%%" % self.doc.name, self.doc.item_code), as_dict=1) def on_trash(self): if self.doc.status == 'Delivered':