Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to add field in 2 tables same time?

By
Mostafa Mohamed Abdelmonam Abdo
on 4/8/15, 11:38 AM 353 views


I have model table called student,the student should be registered in 1 group and 1 standard.

I want that when choosing standard and group on creating student

the student should automatically added to standard table model and group table model

here is my fields in student model table

'standard_id': fields.many2one('fci.standard', string='Standard', required=True),

'group_id': fields.many2one('fci.standard.groups',string='Groups(s)'),

and here is my field that should be updated in standard model table

'student_ids': fields.many2many('fci.student', 'student_standard_rel', 'fci_student_standard_id', 'standard_id',

string='Student(s)'),

'groups_ids': fields.many2many('fci.standard.groups', 'standard_group_rel', 'fci_standard_group_id', 'standard_group_id',

string='Groups(s)'),

and here is my fields in group table model:

'student_ids': fields.many2many('fci.student', 'students_groups_rel', 'group_student_rel', 'student_group_id',string='Student(s)'),

I have idea maybe a solution to (to create related field but i can't do it with many2many fields )

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/8/15, 11:38 AM
Seen: 353 times
Last updated: 4/8/15, 11:38 AM