I've created a module "school" in which I have a One2many field "remarks_lines_ids", now I want this "remarks_lines_ids" field to be inherit in "sale" module (addons).
I tried this by the way. #School Module........student.py
class StudentStudent(models.Model):
_name = 'student.student'
name = fields.Char(string='Name', required=True)
class RemarksLine(models.Model):
_name = 'remarks.line'
remarks = fields.Char(string='Remarks')
student_id = fields.Many2one('student.student', string='Student')
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
remarks_lines_ids = fields.One2many('remarks.line', 'student_id',
string='Remarks Lines')
<!-- student_view.xml -->
<record id="sale_order_lines_inherit" model="ir.ui.view">
<field name="name">sale.order.lines.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page[@name='order_lines']" position="inside">
<notebook>
<page string="Remarks Line">
<field name="remarks_lines_ids">
<tree string="Remarks Line">
<field name="remarks"/>
</tree>
<form string="Remarks Line">
<group>
<field name="remarks"/>
</group>
</form>
</field>
</page>
</notebook>
</xpath>
</field>
</record>