fix: naming series
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "CHP.",
|
"autoname": "format:{####} {title}",
|
||||||
"creation": "2021-05-03 05:49:08.383057",
|
"creation": "2021-05-03 05:49:08.383050",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "LES.",
|
"autoname": "format:{####} {title}",
|
||||||
"creation": "2021-05-03 06:21:12.995987",
|
"creation": "2021-05-03 06:21:12.995981",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"fieldname": "chapter",
|
"fieldname": "chapter",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Chapter",
|
"label": "Course Chapter",
|
||||||
"options": "Course Chapter",
|
"options": "Course Chapter",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ community.patches.v0_0.course_instructor_update
|
|||||||
execute:frappe.delete_doc("DocType", "Discussion Message")
|
execute:frappe.delete_doc("DocType", "Discussion Message")
|
||||||
execute:frappe.delete_doc("DocType", "Discussion Thread")
|
execute:frappe.delete_doc("DocType", "Discussion Thread")
|
||||||
community.patches.v0_0.rename_chapters_and_lessons_doctype
|
community.patches.v0_0.rename_chapters_and_lessons_doctype
|
||||||
community.patches.v0_0.rename_chapter_and_lesson_doctype #26-09-2021
|
community.patches.v0_0.rename_chapter_and_lesson_doctype #27-09-2021
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ def move_chapters():
|
|||||||
def move_lessons():
|
def move_lessons():
|
||||||
docs = frappe.get_all("Lesson", fields=["*"])
|
docs = frappe.get_all("Lesson", fields=["*"])
|
||||||
for doc in docs:
|
for doc in docs:
|
||||||
|
print(frappe.db.exists("Chapter", doc.chapter))
|
||||||
if frappe.db.exists("Chapter", doc.chapter):
|
if frappe.db.exists("Chapter", doc.chapter):
|
||||||
keys = doc
|
keys = doc
|
||||||
|
print(doc)
|
||||||
keys.update({"doctype": "Course Lesson"})
|
keys.update({"doctype": "Course Lesson"})
|
||||||
del keys["name"]
|
del keys["name"]
|
||||||
frappe.get_doc(keys).save()
|
frappe.get_doc(keys).save()
|
||||||
|
|||||||
Reference in New Issue
Block a user