[fix] frappe.db.exists('Series', series) is not working because tabSeries table did not have column modified

This commit is contained in:
Rohit Waghchaure 2017-04-28 12:56:26 +05:30 committed by Nabin Hait
parent 0e6ac8b9b4
commit ac28ffb41e

View File

@ -141,7 +141,7 @@ class NamingSeries(Document):
def insert_series(self, series): def insert_series(self, series):
"""insert series if missing""" """insert series if missing"""
if not frappe.db.exists('Series', series): if not frappe.db.get_value('Series', series, 'name', order_by="name"):
frappe.db.sql("insert into tabSeries (name, current) values (%s, 0)", (series)) frappe.db.sql("insert into tabSeries (name, current) values (%s, 0)", (series))
def update_series_start(self): def update_series_start(self):