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

This is my XML view. Everything is okay but the search isn't working. I don't find any issue about that.


<?xml version="1.0" encoding="UTF-8"?>

<odoo>
<record model="ir.ui.view" id="session_form_view">
<field name="name">session.form</field>
<field name="model">openacademy.session</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="start_date"/>
<field name="duration"/>
<field name="seats"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<record model="ir.ui.view" id="session_tree_view">
<field name="name">session.tree</field>
<field name="model">openacademy.session</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="start_date"/>
<field name="duration"/>
<field name="seats"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="session_search_view">
<field name="name">session.search</field>
<field name="model">openacademy.session</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="start_date"/>
<field name="duration"/>
<field name="seats"/>
</search>
</field>
</record>

<record model="ir.actions.act_window" id="session_actions_menu">
<field name="name">Session</field>
<field name="res_model">openacademy.session</field>
<field name="view_type">form</field>
<field name="view_mode">search,tree,form</field>
</record>

<menuitem id="session_menu" name="Session" parent="openacademy_menu" action="session_actions_menu"/>
</odoo>
Avatar
Discard
Best Answer

Hello Asaduzaaman Sohel,

You can't define search view in view_mode. You can assign search record id to action like below.

<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="session_search_view"/>

Hope it works for you.
Thanks,

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 24
336
1
Sep 23
1027
2
Aug 22
6355
8
Jun 20
19651
1
Apr 20
53