This question has been flagged
3538 Views

Hi
I have done the following so that I can modify the tree view of the 'search more...' popup: This is my new Tree view, I just added two new fields that I created to verify if my module works(prhalfc,prhighc):

  <record id="new_tree_view" model="ir.ui.view">
        <field name="name">new.product.tree</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <tree string="Products">
               <!-- <field name="default_code"/> --> 
                <field name="name"/>
                <field name="qty_available"/>
                <field name="virtual_available"/>
                <field name="lst_price"/>
                <field name="prhighc"/>
                <field name="prhalfc"/>
            </tree>
        </field>
    </record

And the I made the following inhiratance of the sale.view_order_form:

  <record id="new_tree_in_sale_order" model="ir.ui.view">
       <field name="name">new_tree_in_sale_order</field>
       <field name="model">sale.order</field>
       <field name="type">form</field>
       <field name="inherit_id" ref="sale.view_order_form"/>
       <field name="arch" type="xml">   
          <xpath expr="//field[@name='product_id']" position="attributes">
                <attribute name="context">{'tree_view_ref':'product.new_tree_view'}</attribute>
         </xpath>
        </field>
   </record>

But it seems like the part : <attribute name="context">{'tree_view_ref':'product.new_tree_view'}</attribute> does nothing because the popup does not change

Could you give me some suggestions??

Thanks in advance!!

Avatar
Discard

Don't forget to specify complete external id of tree view that you want to display on search more popup.