콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7404 화면

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
8706
1
8월 16
8307
2
2월 24
14610
2
5월 21
6789
0
1월 25
1378