diff --git a/community/lms/doctype/course_chapter/course_chapter.json b/community/lms/doctype/course_chapter/course_chapter.json index 2956fbe9..63ce8e87 100644 --- a/community/lms/doctype/course_chapter/course_chapter.json +++ b/community/lms/doctype/course_chapter/course_chapter.json @@ -1,8 +1,8 @@ { "actions": [], "allow_rename": 1, - "autoname": "CHP.", - "creation": "2021-05-03 05:49:08.383057", + "autoname": "format:{####} {title}", + "creation": "2021-05-03 05:49:08.383050", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", diff --git a/community/lms/doctype/course_lesson/course_lesson.json b/community/lms/doctype/course_lesson/course_lesson.json index 03606e82..bacf3f47 100644 --- a/community/lms/doctype/course_lesson/course_lesson.json +++ b/community/lms/doctype/course_lesson/course_lesson.json @@ -1,8 +1,8 @@ { "actions": [], "allow_rename": 1, - "autoname": "LES.", - "creation": "2021-05-03 06:21:12.995987", + "autoname": "format:{####} {title}", + "creation": "2021-05-03 06:21:12.995981", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", @@ -22,7 +22,7 @@ "fieldname": "chapter", "fieldtype": "Link", "in_list_view": 1, - "label": "Chapter", + "label": "Course Chapter", "options": "Course Chapter", "reqd": 1 }, diff --git a/community/patches.txt b/community/patches.txt index e386940b..7651b808 100644 --- a/community/patches.txt +++ b/community/patches.txt @@ -12,4 +12,4 @@ community.patches.v0_0.course_instructor_update execute:frappe.delete_doc("DocType", "Discussion Message") execute:frappe.delete_doc("DocType", "Discussion Thread") 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 diff --git a/community/patches/v0_0/rename_chapter_and_lesson_doctype.py b/community/patches/v0_0/rename_chapter_and_lesson_doctype.py index b6863b6f..f86d5f2b 100644 --- a/community/patches/v0_0/rename_chapter_and_lesson_doctype.py +++ b/community/patches/v0_0/rename_chapter_and_lesson_doctype.py @@ -25,8 +25,10 @@ def move_chapters(): def move_lessons(): docs = frappe.get_all("Lesson", fields=["*"]) for doc in docs: + print(frappe.db.exists("Chapter", doc.chapter)) if frappe.db.exists("Chapter", doc.chapter): keys = doc + print(doc) keys.update({"doctype": "Course Lesson"}) del keys["name"] frappe.get_doc(keys).save()