title: How to inherit One2many field in Odoo 12?
body: <p>I've created a module &quot;school&quot; in which I have a One2many field &quot;remarks_lines_ids&quot;, now I want this &quot;remarks_lines_ids&quot; field to be inherit in &quot;sale&quot; module (addons).</p>
  <p>I tried this by the way.
  #School Module........student.py</p>
  <pre><code>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')
  
  
  &lt;!-- student_view.xml --&gt;
  &lt;record id=&quot;sale_order_lines_inherit&quot; model=&quot;ir.ui.view&quot;&gt;
      &lt;field name=&quot;name&quot;&gt;sale.order.lines.inherit&lt;/field&gt;
      &lt;field name=&quot;model&quot;&gt;sale.order&lt;/field&gt;
      &lt;field name=&quot;inherit_id&quot; ref=&quot;sale.view_order_form&quot;/&gt;
      &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;
          &lt;xpath expr=&quot;/form/sheet/notebook/page[@name='order_lines']&quot; position=&quot;inside&quot;&gt;
              &lt;notebook&gt;
                  &lt;page string=&quot;Remarks Line&quot;&gt;
                      &lt;field name=&quot;remarks_lines_ids&quot;&gt;
                          &lt;tree string=&quot;Remarks Line&quot;&gt;
                              &lt;field name=&quot;remarks&quot;/&gt;
                          &lt;/tree&gt;
  
                          &lt;form string=&quot;Remarks Line&quot;&gt;
                              &lt;group&gt;
                                  &lt;field name=&quot;remarks&quot;/&gt;
                              &lt;/group&gt;
                          &lt;/form&gt;
                      &lt;/field&gt;
                  &lt;/page&gt;
              &lt;/notebook&gt;
          &lt;/xpath&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  </code></pre>