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)