title: How to change fields.One2Many view in odoo 12?
body: <p>i trying to create fields.One2Many for my invoice module, i create two different module, one called ms_produk and another called invoice, then for the ms_produk i use as master product, which serve CRUD for item and have a table named "ms_produk_ms_produk"</p>
  
  <p>here is my ms_produk model looked like :</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  from odoo import models, fields, api
  
  class ProdukProduk(models.Model):
      _name = 'ms_produk.ms_produk'
  
      kd_produk = fields.Char(String='Kode Produk', required=True)
      nm_produk = fields.Char(String='Nama Produk', required=True)
      tanggal_input = fields.Datetime(string='Tanggal Input', default=fields.Datetime.now())
      tanggal_aktif = fields.Datetime(string='Tanggal Aktif', default=fields.Datetime.now())
      status_aktif = fields.Boolean('Status Aktif', default=True)
      keterangan = fields.Html(string='Keterangan')
  
      no_faktur = fields.Many2one('salesorder.salesorder')
  </code></pre>
  
  <p>i add </p>
  
  <blockquote>
    <p>no_faktur = fields.Many2one('salesorder.salesorder')</p>
  </blockquote>
  
  <p>to link this table to my invoice module, since i want to use One2Many function at my invoice module</p>
  
  <p>then here is my invoice module model looked like, this model named "salesorder.py" :</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  from odoo import models, fields, api
  
  class SalesorderSalesorder(models.Model):
      _name = 'salesorder.salesorder'
  
      no_faktur = fields.Char(String='No Faktur', required=True)
      kd_dealer = fields.Char(String='Kode Dealer', required=True)
      nm_dealer = fields.Char(String='Nama Dealer', required=True)
      tanggal_faktur = fields.Datetime(string='Tgl Faktur', default=fields.Datetime.now())
      keterangan = fields.Html(string='Keterangan')
      kd_sales = fields.Many2one('res.users', string='Kode Sales')
      details = fields.One2many('ms_produk.ms_produk','no_faktur','List Item')
  </code></pre>
  
  <p>this worked, when i click "add a line" it pop out my master product module, but it show in input form, how i changed it to list only? so i can pick some item to add as detail for my invoice?</p>
  
  <p>SNAPSHOT :
  salesorder form :
  <a href="https://i.stack.imgur.com/nPlO5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPlO5.png" alt="enter image description here"></a></p>
  
  <p>when i click "add a line", it showed up a form like this : (this is input form, i need list view of my product)</p>
  
  <p><a href="https://i.stack.imgur.com/oL82s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oL82s.png" alt="enter image description here"></a></p>
  
  <p>it should be a list of my item produk, that looked like this : (this is snapshot from my master module)</p>
  
  <p><a href="https://i.stack.imgur.com/apR8o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apR8o.png" alt="enter image description here"></a></p>
  
  <p>then i will added like this : (this is a example snapshot i take from Thayif Kabir <a href="https://www.serpentcs.com/serpentcs-relational-fields-in-openerp-270" rel="nofollow noreferrer">link</a></p>
  
  <p><a href="https://i.stack.imgur.com/u8BqP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u8BqP.png" alt="enter image description here"></a></p>
  
  <p>**UPDATED CODE as @Ajmal JK answer, i tried to edit my salesorder_view.xml, and breakdown some code, here is how it looked like now :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;odoo&gt;
      &lt;data&gt;
  
          &lt;record id="salesorder_menu_action" model="ir.actions.act_window"&gt;
              &lt;field name="name"&gt;SalesOrders&lt;/field&gt;
              &lt;field name="res_model"&gt;salesorder.salesorder&lt;/field&gt;
              &lt;field name="view_type"&gt;form&lt;/field&gt;
              &lt;field name="view_mode"&gt;tree,form&lt;/field&gt;
              &lt;field name="domain"&gt;[]&lt;/field&gt;
              &lt;field name="help" type="html"&gt;
                  &lt;p class="oe_view_nocontent_create"&gt;Create SalesOrders
                  &lt;/p&gt;
              &lt;/field&gt;
          &lt;/record&gt;
  
  &lt;!-- newly added --&gt;
  
          &lt;!-- salesorder view --&gt;
          &lt;record id="salesorder_tree" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;salesorder.form.tree&lt;/field&gt;
              &lt;field name="model"&gt;salesorder.salesorder&lt;/field&gt;
              &lt;field name="type"&gt;tree&lt;/field&gt;
              &lt;field name='arch' type="xml"&gt;
                  &lt;field name='details'&gt;
                      &lt;tree string="SalesOrder" editable="bottom"&gt;
                          &lt;field name="kd_produk"/&gt;
                          &lt;field name="nm_produk"/&gt;
                      &lt;/tree&gt;
                  &lt;/field&gt;
              &lt;/field&gt;
          &lt;/record&gt;
          &lt;!-- end of salesorder view --&gt;
  
          &lt;!-- master product view --&gt;
          &lt;record id="browse_msproduk_tree_view" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;ms_produk&lt;/field&gt;
              &lt;field name="model"&gt;ms_produk.ms_produk&lt;/field&gt;
              &lt;field name="view_mode"&gt;tree&lt;/field&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;tree editable="bottom"&gt;
                      &lt;field name="kd_produk"/&gt;
                      &lt;field name="nm_produk"/&gt;
                      &lt;field name="tanggal_input"/&gt;
                  &lt;/tree&gt;
              &lt;/field&gt;
              &lt;field name="view_id" ref="salesorder_tree"/&gt;
              &lt;field name="act_window_id" ref="salesorder_menu_action"/&gt;
          &lt;/record&gt;
          &lt;!-- end of master product view --&gt;
  
  &lt;!-- end of newly added --&gt;
  
          &lt;menuitem id="salesorder_menu" name="SalesOrder"/&gt;
          &lt;menuitem id="Salesorder_neworder_menu" 
                  parent="salesorder_menu" 
                  name="New Order"
                  action="salesorder_menu_action"/&gt;
      &lt;/data&gt;
  &lt;/odoo&gt;
  </code></pre>
  
  <p>there is no error when i run this code, it worked but not how i want it to be, when giving this code <code>&lt;tree editable="bottom"&gt;</code> in <strong><em>Master Product View</em></strong> section they become inline editable, so i have to type each column, what i need is a popup window that contain list of product so i can pick it and put in the details form, i try do <code>&lt;tree editable="bottom"&gt;</code> then i try                     <code>&lt;tree string="details"&gt;</code> with no editable tag, it comeback to popup but it's an input form, it should be list of product so i can check the item and add it into the details table, how do i do this?</p>