fix: batch course sequence id issue
This commit is contained in:
@@ -245,6 +245,10 @@ def fetch_lessons(courses):
|
||||
@frappe.whitelist()
|
||||
def add_course(course, parent, name=None, evaluator=None):
|
||||
frappe.only_for("Moderator")
|
||||
|
||||
if frappe.db.exists("Batch Course", {"course": course, "parent": parent}):
|
||||
frappe.throw(_("Course already added to the batch."))
|
||||
|
||||
if name:
|
||||
doc = frappe.get_doc("Batch Course", name)
|
||||
else:
|
||||
|
||||
@@ -68,4 +68,5 @@ lms.patches.v1_0.rename_lms_batch_membership_doctype
|
||||
lms.patches.v1_0.rename_lms_class_to_lms_batch
|
||||
lms.patches.v1_0.rename_classes_in_navbar
|
||||
lms.patches.v1_0.publish_batches
|
||||
lms.patches.v1_0.publish_certificates
|
||||
lms.patches.v1_0.publish_certificates
|
||||
lms.patches.v1_0.change_naming_for_batch_course #14-09-2023
|
||||
6
lms/patches/v1_0/change_naming_for_batch_course.py
Normal file
6
lms/patches/v1_0/change_naming_for_batch_course.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
frappe.db.create_sequence("Batch Course", check_not_exists=True)
|
||||
frappe.db.set_next_sequence_val("Batch Course", 500, is_val_used=False)
|
||||
@@ -31,6 +31,7 @@ const show_course_modal = (e) => {
|
||||
reqd: 1,
|
||||
only_select: 1,
|
||||
default: course || "",
|
||||
read_only: course ? 1 : 0,
|
||||
},
|
||||
{
|
||||
fieldtype: "Link",
|
||||
|
||||
Reference in New Issue
Block a user