Skip to main content

Posts

Showing posts with the label odoo relations

Relations between different tables in modules in odoo

  Many2One Relationship 1. we have school_profile table (module) 2. we have school_students table (module) so school can have many student and the relationship between these to table will be one-to-many Inside School_Students In model define Forieng key field like so name = fields.Char() school_id = fields.Many2one( "school.profile" , string = "School" ) Show in XML file as separate view. <record model ="ir.ui.view" id ="school_students.form" > <field name ="name" > school_students.form </field> <field name ="model" > school.students </field> <field name ="arch" type ="xml" > <form> <group> <group> <field name ="name" /> <field name ="school_id" string ="School" /> </group> </group> </form> </field> </record...