fix(Patch): only insert expression key if not exists
This commit is contained in:
parent
839477e422
commit
5b8bde97bb
1 changed files with 5 additions and 1 deletions
|
|
@ -56,4 +56,8 @@ def execute():
|
|||
current = current[0].get("current")
|
||||
|
||||
for uniq_expr in uniq_exprs:
|
||||
(frappe.qb.into(Series).columns("name", "current").insert(uniq_expr, current + 1)).run()
|
||||
expr_exists = (frappe.qb.from_(Series).select("*").where(Series.name == uniq_expr)).run(
|
||||
as_dict=True
|
||||
)
|
||||
if not expr_exists:
|
||||
(frappe.qb.into(Series).columns("name", "current").insert(uniq_expr, current + 1)).run()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue