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

Hello guys!

I have applied a domain to a field. It works well.

But now, even administrator can see only his own user_id in the field. This it not what I want.

How to applied a domain only for user in base.group_user group?

Thanks!!!

<record id="hr_timesheet_sheet_form" model="ir.ui.view">
            <field name="name">hr.timesheet.form.inherited.vtm2</field>
            <field name="model">hr_timesheet_sheet.sheet</field>
            <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
            <field name="arch" type="xml">
                <field name="employee_id" position="replace">
                    <field name="employee_id" domain="[('user_id', '=', user_id)]"  />
                </field>
            </field>
        </record>


아바타
취소
베스트 답변

Use the groups_id to make that view only apply to a specific group (like 'Employees'):

<field name="groups_id" eval="[(6, 0, [ref('base.group_user') ])]"/>
아바타
취소

If you need two groups, with two domains, create two views - one for each group.

작성자

Big thanks for this precious answer.

I have declared two views : one view for the group base.group_user and an other view for the hr.group_hr_manager group.

But don't forget the field <name="priority">100</field> who seems to make a big difference.

관련 게시물 답글 화면 활동
0
3월 23
1878
1
11월 19
5174
2
11월 18
5341
1
7월 17
14773
1
12월 16
8045