fix: naming series - cannot reset current value to zero (#23504)

This commit is contained in:
Saqib 2020-10-04 18:13:24 +05:30 committed by GitHub
parent 5bf35e465e
commit 2016a34e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import cstr from frappe.utils import cstr, cint
from frappe import msgprint, throw, _ from frappe import msgprint, throw, _
from frappe.model.document import Document from frappe.model.document import Document
@ -159,7 +159,7 @@ class NamingSeries(Document):
prefix = self.parse_naming_series() prefix = self.parse_naming_series()
self.insert_series(prefix) self.insert_series(prefix)
frappe.db.sql("update `tabSeries` set current = %s where name = %s", frappe.db.sql("update `tabSeries` set current = %s where name = %s",
(self.current_value, prefix)) (cint(self.current_value), prefix))
msgprint(_("Series Updated Successfully")) msgprint(_("Series Updated Successfully"))
else: else:
msgprint(_("Please select prefix first")) msgprint(_("Please select prefix first"))