跳至內容
選單
此問題已被標幟
2 回覆
7364 瀏覽次數

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.


頭像
捨棄
最佳答案


Try it

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




頭像
捨棄
最佳答案

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

頭像
捨棄

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

相關帖文 回覆 瀏覽次數 活動
1
1月 18
8611
1
8月 16
8237
2
2月 24
14466
2
5月 21
6727
0
1月 25
1300