Metatron_Student_ERP/create_student.py
2026-10-01 11:16:50 +05:30

12 lines
413 B
Python

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,
})
env.cr.commit()
print("CREATED STUDENT ID:", student.id, "LINKED TO USER ID:", user.id)