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

Hello! I am new to odoo.. here is the situation.. i have a menu that will list all the doctors.. but what i want is that.. when clicking the menu.. it will redirect to the specific doctor not the list of doctors.. do you have any idea to achieve this?

Avatar
Discard
Best Answer

Hi,

Either you can give domain for the action of the menu item or you can call the python function on clicking menu item and then return the necessary view with filtered records from there.


See the sample of how the domain is given for a menu item,

<record id="rating_rating_action_task" model="ir.actions.act_window">
<field name="name">Customer Ratings</field>
<field name="res_model">rating.rating</field>
<field name="view_mode">kanban,tree,pivot,graph,form</field>
<field name="domain">[('res_model', '=', 'project.task'), ('res_id', '=', active_id), ('consumed', '=', True)]</field>
<field name="search_view_id" ref="rating_rating_view_search_project"/>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No customer ratings yet
</p><p>
Customer ratings on tasks. If you have no rating, change your project Settings to activate it.
</p>
</field>
</record>

For calling python function from menu item and to return filtered records see this video : How To Call Python Function From Menu Item in Odoo


Thanks

Avatar
Discard
Best Answer

A doctor's record needs to be selected by the user before it is displayed. In your scenario, how will the system know which doctor's record to display?

Avatar
Discard