Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Can anyone explain to me how to filter the view when i click on a smart button? I have tried domain = {'employee_id': [active_id]}

Drees Far
on 8/1/16, 11:28 AM 280 views

Hello everybody!!!

Can anyone explain to me how to filter in the view when i click on a smart button.

Here is what i have tried :

<record model="ir.actions.act_window" id="action_contract_filtre">

<field name="name">Contracts</field>

<field name="res_model">hr.contract</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="domain">{'employee_id': [active_id]}</field>


Is here any answer.

THanks a lot in advance.

Best Regards.

On 8/1/16, 11:55 PM

Try it

<field name="domain">[('employee_id','=',active_id)]</field>

On 8/2/16, 6:43 AM

Staff view file :

<button type="action" name="%(college.studentaction_window)d"

class="oe_stat_button" icon="fa-fire"

context="{'search_default_staff_id': active_id}">

<field name="students_count" string="Student List" widget="statinfo" />


search_default_staff_id is related to student staff_id

Student py file:

staff_id = fields.Many2one('college.staff', string="staff iD")

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 8/1/16, 11:28 AM
Seen: 280 times
Last updated: 8/2/16, 6:43 AM