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

Hello,

I'm trying to open a specific employee form view from a hierarchical tree view. I started by using the same method as accounting "Chart of accounts" but without success.

Here is my code using another method found on the forum https://www.odoo.com/fr_FR/forum/aide-1/question/passing-active-id-to-action-window-in-openerp7-46706 :

<record model="ir.actions.act_window" id="action_employee_items">
    <field name="name">Employee Details</field>
    <field name="res_model">hr.employee</field>
    <field name="view_type">form</field>
    <field name="view_id" ref="view_hr_employee_form_inherited"/>
    <field name="view_mode">form</field>
    <field name="context">{'res_id': active_id}</field>
</record>

The form opens empty because he cannot get the active_id.

If i put <field name="res_id">INT</field> it works but without variable...

I think I'm missing something but I don't know what.

Thanks for your help guys

Avatar
Discard
Author Best Answer

Hi Axel,

Thank you for your reply. I don't understand clearly what you meant. I need, on the tree view, to open the form view of the employee. If I create an action on the form view it won't be executed before right ?? How to trigger it?

Avatar
Discard
Best Answer

You cannot use variables in the action definition for xml, you need to change the action for the hierarchical tree view to use the view_hr_employee_form_inherited, could be creating an ir.actions.act_window.view for the form view and linked to the action

Avatar
Discard