The below sample code design based on your requirement.
pyhton code:-
class sample_order(osv.osv):
_name = "sample.order"
_columns = {
'name' : fields.char('Name', size=64),
'order_line': fields.one2many('sample.order', 'line_id', 'Order Lines'),
}
class sample_order_line(osv.osv):
_name = "sample.order.line"
_columns = {
'name' : fields.char('Name', size=64),
'order_subline': fields.one2many('sample.order.line', 'subline_id', 'Order Lines'),
'line_id' : fields.many2one('sample_order', 'Line'),
}
class sample_line_subline(osv.osv):
_name = "sample.line.subline"
_columns = {
'name' : fields.char('Name', size=64),
'subline_id' : fields.many2one('sample.order.line', 'Line'),
}
xml file:-
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_sample_order_form" model="ir.ui.view">
<field name="name">sample.order.form</field>
<field name="model">sample.order</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sample Order">
<field name="name"/>
<notebook colspan="4">
<page string="Order Line">
<field name="order_line" nolabel="1" colspan="4">
<form string="Order">
<field name="name"/>
<notebook colspan="4">
<page string="Sub Line">
<field name="order_subline" nolabel="1" colspan="4">
<form string="Sub Line">
<field name="name"/>
</form>
<tree string="Sub Line">
<field name="name"/>
</tree>
</field>
</page>
</notebook>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
</data>
</openerp>