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

I am trying to add a filter to sale.order tree view:


(record id="sale_tree_search_ext" model="ir.ui.view")    
(field name="name")sale_tree_search_ext.filter(/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")
(xpath expr="/search/filter[1]" position="after")
(filter name="has_special_status" string="has_special_status" domain="[('has_special_status','=',1)]" /)
(/xpath)
(/field)
(/record)

But I get this error:

Unknown field "sale.order.my_activity_date_deadline" in domain of < filter name="activities_overdue" > "[('my_activity_date_deadline', ')', context_today().strftime('%Y-%m-%d'))]"

Thank you

Avatar
Discard
Best Answer

Hi Andreas,

Actually your code is trying to add your filter "has_special_status" just after the first filter of the "sale_order_view_search_inherit_quotation" filter view. But in general case in sale, there is one common filter "view_sales_order_filter" which are used by both sale and quotation and it update/replace the first filter accordingly.

So instead of the xpath position "(xpath expr="/search/filter[1]" position="after")" you have to go with the xpath by name.

Just like : 

        For Quotation use (xpath expr="//search/filter[@name='my_quotation']" position="after") 
        For Sale Order use (xpath expr="//search/filter[@name='to_invoice']" position="after") 

Hope it will help you. Up vote Please.

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
1483
1
Nov 24
1188
2
Sep 24
1047
1
Aug 24
2451
3
Aug 24
2686