Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2261 Widoki

I'm trying to move my adoons from odoo 10 to odoo 12. I'm getting problem on my custom search view. I've read the documentation for search view but I don't see what's the problem?

Error

odoo.tools.convert.ParseError: "Invalid view pos.order search definition in tabla_pos_12/views/views.xml

None" while parsing /opt/odoo/customaddons/tabla_pos_12/views/views.xml:46, near
<record id="tabla_orders_search_view" model="ir.ui.view">
<field name="inherit_id" ref="point_of_sale.view_pos_order_filter"/>
<field name="model">pos.order</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="before">
<filter string="Month" domain="[('date_order','>=',context_today().strftime('%Y-%m-01')),('date_order','<',(context_today()+relativedelta(months=1)).strftime('%Y-%m-01')) ]"/>
<filter string="Year" domain="[('date_order','>=',context_today().strftime('%Y-01-01')),('date_order','<=',(context_today()+relativedelta(years=1)).strftime('%Y-01-01'))]"/>
<filter string="Last Month" domain="[('date_order','>=',(context_today()-relativedelta(months=1)).strftime('%Y-%m-01')),('date_order','<',time.strftime('%Y-%m-01')) ]"/>
<filter string="Last Year" domain="[('date_order','>=',(context_today()-relativedelta(years=1)).strftime('%Y-01-01')),('date_order','<=', time.strftime('%Y-01-01'))]"/>
</xpath>
</field>
</record>



Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You have to give name along with the filter,

<filter string="Month" name="month" domain="[('date_order','>=',context_today().strftime('%Y-%m-01')),('date_order','<',(context_today()+relativedelta(months=1)).strftime('%Y-%m-01')) ]"/>

As shown above, you can updated other filters too.

Thanks

Awatar
Odrzuć
Autor

Thanks!

Powiązane posty Odpowiedzi Widoki Czynność
0
lut 24
28
2
gru 23
14718
0
paź 23
33
3
paź 23
788
1
paź 23
569