Merge pull request #6925 from rmehta/setup-wizard-fix
[fix] ignore duplicate names for program, academic term, academic year, course, instructor
This commit is contained in:
commit
6209f2f75b
@ -548,35 +548,50 @@ def create_academic_term():
|
||||
academic_term = frappe.new_doc("Academic Term")
|
||||
academic_term.academic_year = y
|
||||
academic_term.term_name = t
|
||||
academic_term.save()
|
||||
try:
|
||||
academic_term.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
def create_academic_year():
|
||||
ac = ["2013-14", "2014-15", "2015-16", "2016-17", "2017-18"]
|
||||
for d in ac:
|
||||
academic_year = frappe.new_doc("Academic Year")
|
||||
academic_year.academic_year_name = d
|
||||
academic_year.save()
|
||||
try:
|
||||
academic_year.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
def create_program(args):
|
||||
for i in xrange(1,6):
|
||||
if args.get("program_" + str(i)):
|
||||
program = frappe.new_doc("Program")
|
||||
program.program_name = args.get("program_" + str(i))
|
||||
program.save()
|
||||
try:
|
||||
program.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
def create_course(args):
|
||||
for i in xrange(1,6):
|
||||
if args.get("course_" + str(i)):
|
||||
course = frappe.new_doc("Course")
|
||||
course.course_name = args.get("course_" + str(i))
|
||||
course.save()
|
||||
try:
|
||||
course.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
def create_instructor(args):
|
||||
for i in xrange(1,6):
|
||||
if args.get("instructor_" + str(i)):
|
||||
instructor = frappe.new_doc("Instructor")
|
||||
instructor.instructor_name = args.get("instructor_" + str(i))
|
||||
instructor.save()
|
||||
try:
|
||||
instructor.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
def create_room(args):
|
||||
for i in xrange(1,6):
|
||||
@ -584,6 +599,9 @@ def create_room(args):
|
||||
room = frappe.new_doc("Room")
|
||||
room.room_name = args.get("room_" + str(i))
|
||||
room.seating_capacity = args.get("room_capacity_" + str(i))
|
||||
room.save()
|
||||
try:
|
||||
room.save()
|
||||
except frappe.DuplicateEntryError:
|
||||
pass
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user