[fix] [minor] fix in serial no
This commit is contained in:
parent
77f37e6b7c
commit
609046990b
@ -11,6 +11,7 @@ def execute():
|
|||||||
for sr in serial_nos:
|
for sr in serial_nos:
|
||||||
sr_bean = webnotes.bean("Serial No", sr[0])
|
sr_bean = webnotes.bean("Serial No", sr[0])
|
||||||
sr_bean.make_controller().via_stock_ledger = True
|
sr_bean.make_controller().via_stock_ledger = True
|
||||||
|
sr_bean.run_method("validate")
|
||||||
sr_bean.save()
|
sr_bean.save()
|
||||||
|
|
||||||
webnotes.conn.sql("""update `tabSerial No` set warehouse='' where status in
|
webnotes.conn.sql("""update `tabSerial No` set warehouse='' where status in
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class DocType(StockController):
|
|||||||
where (serial_no like %s or serial_no like %s or serial_no=%s)
|
where (serial_no like %s or serial_no like %s or serial_no=%s)
|
||||||
and item_code=%s and ifnull(is_cancelled, 'No')='No'
|
and item_code=%s and ifnull(is_cancelled, 'No')='No'
|
||||||
order by name desc limit 1""",
|
order by name desc limit 1""",
|
||||||
("%%%s%%" % self.doc.name+"\n", "%%%s%%" % "\n"+self.doc.name, self.doc.name,
|
("%%%s%%" % (self.doc.name+"\n"), "%%%s%%" % ("\n"+self.doc.name), self.doc.name,
|
||||||
self.doc.item_code), as_dict=1)
|
self.doc.item_code), as_dict=1)
|
||||||
|
|
||||||
if last_sle:
|
if last_sle:
|
||||||
@ -116,7 +116,7 @@ class DocType(StockController):
|
|||||||
where (serial_no like %s or serial_no like %s or serial_no=%s)
|
where (serial_no like %s or serial_no like %s or serial_no=%s)
|
||||||
and item_code=%s and actual_qty > 0
|
and item_code=%s and actual_qty > 0
|
||||||
and ifnull(is_cancelled, 'No')='No' order by name asc limit 1""",
|
and ifnull(is_cancelled, 'No')='No' order by name asc limit 1""",
|
||||||
("%%%s%%" % self.doc.name+"\n", "%%%s%%" % "\n"+self.doc.name, self.doc.name,
|
("%%%s%%" % (self.doc.name+"\n"), "%%%s%%" % ("\n"+self.doc.name), self.doc.name,
|
||||||
self.doc.item_code), as_dict=1)
|
self.doc.item_code), as_dict=1)
|
||||||
|
|
||||||
if purchase_sle:
|
if purchase_sle:
|
||||||
@ -128,7 +128,7 @@ class DocType(StockController):
|
|||||||
if purchase_sle[0].voucher_type == "Purchase Receipt":
|
if purchase_sle[0].voucher_type == "Purchase Receipt":
|
||||||
self.doc.supplier, self.doc.supplier_name = \
|
self.doc.supplier, self.doc.supplier_name = \
|
||||||
webnotes.conn.get_value("Purchase Receipt", purchase_sle[0].voucher_no,
|
webnotes.conn.get_value("Purchase Receipt", purchase_sle[0].voucher_no,
|
||||||
["supplier_name", "supplier_name"])
|
["supplier", "supplier_name"])
|
||||||
else:
|
else:
|
||||||
for fieldname in ("purchase_document_type", "purchase_document_no",
|
for fieldname in ("purchase_document_type", "purchase_document_no",
|
||||||
"purchase_date", "purchase_time", "purchase_rate", "supplier", "supplier_name"):
|
"purchase_date", "purchase_time", "purchase_rate", "supplier", "supplier_name"):
|
||||||
@ -140,7 +140,7 @@ class DocType(StockController):
|
|||||||
and item_code=%s and actual_qty<0
|
and item_code=%s and actual_qty<0
|
||||||
and voucher_type in ('Delivery Note', 'Sales Invoice')
|
and voucher_type in ('Delivery Note', 'Sales Invoice')
|
||||||
and ifnull(is_cancelled, 'No')='No' order by name desc limit 1""",
|
and ifnull(is_cancelled, 'No')='No' order by name desc limit 1""",
|
||||||
("%%%s%%" % self.doc.name+"\n", "%%%s%%" % "\n"+self.doc.name, self.doc.name,
|
("%%%s%%" % (self.doc.name+"\n"), "%%%s%%" % ("\n"+self.doc.name), self.doc.name,
|
||||||
self.doc.item_code), as_dict=1)
|
self.doc.item_code), as_dict=1)
|
||||||
if delivery_sle:
|
if delivery_sle:
|
||||||
self.doc.delivery_document_type = delivery_sle[0].voucher_type
|
self.doc.delivery_document_type = delivery_sle[0].voucher_type
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user