Skip to Content
Menu
This question has been flagged
2 Replies
7346 Rodiniai

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>

</record>

Is here any answer.

THanks a lot in advance.

Best Regards.


Portretas
Atmesti
Best Answer


Try it

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




Portretas
Atmesti
Best Answer

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" />

</button>

search_default_staff_id is related to student staff_id

Student py file:

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

Portretas
Atmesti

In order for this to work you need to define a search view and add staff_id field there

Related Posts Replies Rodiniai Veikla
1
saus. 18
8585
1
rugp. 16
8189
2
vas. 24
14429
2
geg. 21
6682
0
saus. 25
1270