o1-mini-2024-09-12· OpenAI
WildChat-4.8M (AI2)
<?xml version="1.0" encoding="utf-8"?> <odoo> <data> <!-- Custom Tree View for user -->…
- Usercode
- Assistant
To ensure that clicking on an item in the tree view opens its detail (form) view, you need to include the
formview in theview_modeof youraction_user_list. This allows Odoo to know which form view to display when a tree item is clicked.Here's the minimal change you need to make in your XML:
xml<record id="action_user_list" model="ir.actions.act_window"> <field name="name">Users</field> <field name="res_model">res.users</field> <field name="view_mode">kanban,tree,form</field> <!-- Added 'form' here --> <field name="view_id" ref="view_user_tree_custom"/> </record>Explanation:
view_mode="kanban,tree,form": By addingformto theview_mode, you instruct Odoo to open the form view when an item in the tree view is clicked. This integrates the tree and form views within the same action, enabling seamless navigation and CRUD operations.