31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
campus = env["education.campus"].search([], limit=1)
|
|
if not campus:
|
|
campus = env["education.campus"].create({"name": "Test Campus"})
|
|
dept = env["education.department"].search([], limit=1)
|
|
if not dept:
|
|
dept = env["education.department"].create({"name": "Test Dept"})
|
|
prog = env["education.program"].search([], limit=1)
|
|
if not prog:
|
|
prog = env["education.program"].create({"name": "Test Program"})
|
|
year = env["education.academic.year"].search([], limit=1)
|
|
if not year:
|
|
year = env["education.academic.year"].create({"name": "2026"})
|
|
user = env["res.users"].search([("login", "=", "demo.student")], limit=1)
|
|
if user:
|
|
student = env["education.student"].create({
|
|
"full_name": "Demo Student",
|
|
"first_name": "Demo",
|
|
"last_name": "Student",
|
|
"email": "demo.student@example.com",
|
|
"portal_user_id": user.id,
|
|
"campus_id": campus.id,
|
|
"department_id": dept.id,
|
|
"program_id": prog.id,
|
|
"academic_year_id": year.id,
|
|
"date_of_birth": "2000-01-01",
|
|
"gender": "other",
|
|
"admission_number": "ADM-9999",
|
|
"student_id": "STU-9999"
|
|
})
|
|
env.cr.commit()
|