Skip to Content
Menu
This question has been flagged
1 Reply
2001 Views

I have odoo ver 13 enterprise

I have custom field many2one in sale order line i want this field in quotation/sale tree view "ADD CUSTOM FILTER"

need sample code.
















Avatar
Discard

to do this u need inherit the views: https://goo.gl/fGNfBY

Best Answer

Hi ,

<field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>

Hope it Helps,
Kiran K

Avatar
Discard
Author

i need in tag <filter

Author

I need in "ADD CUSTOM FILTER" where i can select my itemype field and in comtain i put values for search filter.
here is my sample code for correction.

<record id="search_sale_order_ept" model="ir.ui.view">
<field name="name">search_sale_order_ept</field>
<field name="model">sale.order</field>
<field name="type">search</field>
<field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="arch" type="xml">
<filter name="filter_create_date" position="after">
<filter name="filter_itemtype" string="item type" domain="[('order_line.itemtype', 'ilike', self)]"/>
</filter>
</field>

</record>

<filter name="quantity" string="Quantity" domain="[('order_line.quantity','=',1)]"/>