fix: naming series - cannot reset current value to zero (#23504)
This commit is contained in:
parent
5bf35e465e
commit
2016a34e30
@ -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"))
|
||||||
|
Loading…
Reference in New Issue
Block a user