[minor] check serial no filedtype before updating (#9126)

* Update serial_no.py

Takes care of Different FieldTypes

* [minor] check serial no filedtype before updating
This commit is contained in:
Makarand Bauskar 2017-06-07 11:54:26 +05:30 committed by Nabin Hait
parent 214e6906e5
commit db8363e9eb

View File

@ -160,7 +160,7 @@ class SerialNo(StockController):
def after_rename(self, old, new, merge=False):
"""rename serial_no text fields"""
for dt in frappe.db.sql("""select parent from tabDocField
where fieldname='serial_no' and fieldtype='Text'"""):
where fieldname='serial_no' and fieldtype in ('Text', 'Small Text')"""):
for item in frappe.db.sql("""select name, serial_no from `tab%s`
where serial_no like '%%%s%%'""" % (dt[0], frappe.db.escape(old))):