# GEMS Education - Part 3

# Sequences

Sequence form view

User form view

Contact without gender

WARNING

Student ID must be generated in res.partner, only for students, by checking the field Member Type in res.users.

There is a relational field user_ids that could be used to access Member Type. However, res.users and res.partner are implemented using delegation inheritance due to which user_ids.member_type may not work. Therefore, the correct way to implement is to add the original field in res.partner and to make the field in res.users into a related field from partner_id. You can follow this example (opens new window) from the standard source code. Now you can simply check member_type in the create() method of res.partner to decide whether to generate a sequence.

Contact with gender

TIP

The current workflow is such that a student is created through res.users model and gender is not set there during the creation. Instead, it is set by going to the related contact. Therefore, the write() method should be overridden to update Student ID's prefix from X to M or F whenever gender is updated.

# Activities

Wizard to add students to session

TIP

It is better to prevent the user from creating students here. This way, when you override write() to create activities, you will only have to check if students were added to sessions and not if created.

Students added to session

Activities list view

Activities form view