Mahmoud,
For the notebook need a One2many
field in main class to the notebook's class and need a Many2one
field from notebook's class to the main class. And add that One2many field in the xml before the tree tag.
For example:
class Mainclass(models.Model):
_name = 'main.class'
notebook_ids = fields.One2many('notebook.class', 'main_class_id', string="Notebook")
class NotebookClass(models.Model):
_name = 'notebook.class'
main_class_id = fields.Many2one('main.class', string="Main Class")
name = fields.Char(string="Name")
state = fields.Char(string="state")
In the XML you have to add,
<notebook>
<page>
<field name="notebook_ids">
<tree>
<field name="name"/>
<field name="state"/>
</tree>
</field>
</page>
</notebook>
Add One2many field on wherever you need to add a notebook. And notebook field's should be written in an another class.
Thanks in advance ! Happy Coding !