Skip to Content
Menu
This question has been flagged
2 Replies
3166 Views

Hi guys 
i m trying to implement a new filter on order by adding an email and a phone filter in my order list view.
I have an error : 

This domain is syntactically not correct: [[u'state', u'not in', [u'draft', u'sent', u'cancel']], u'|', u'|', [u'partner_id.email', u'ilike', u'OFR']]


Here is my code :



<record model="ir.ui.view" id="sale_order_search_fields">    
<field name="priority">100</field>   
 <field name="model">sale.order</field>    
<field name="inherit_id" ref="sale.view_sales_order_filter"/> 
 <field name="arch" type="xml">        
 <xpath expr="//field[@name='name']" position="replace"/>   
 <xpath expr="//field[@name='partner_id']" position="before"> 
 <field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>        
<field name="name" string="origin" filter_domain="['|',('origin','ilike',self)]"/>           
 <field name="name" string="email" filter_domain="['|',('partner_id.email','ilike',self)]"/>  
 <field name="name" string="phone" filter_domain="['|',('partner_id.phone','ilike',self)]"/>  
 </xpath>   
 </field>
</record>​

Could you tell me why i have this error in all my filters please?
Thanks a lot 
Thomas

Avatar
Discard
Best Answer

Hi, you must create a related field in your model(sale.order)

email = fields.Char(related="partner_id.email", store=True)

and in the search view you need to add:

<filter name="email"
string="Email"
domain="[]"
context="{'group_by':'email'}"/>


Avatar
Discard
Author Best Answer

Noone has an idea for me? :(

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 18
238
1
Nov 17
8501
6
Dec 23
18631
3
Mar 17
3004
0
Feb 23
936