Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
14316 Widoki

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>


Awatar
Odrzuć
Najlepsza odpowiedź

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') ])]"/>
Awatar
Odrzuć

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

Autor

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.

Powiązane posty Odpowiedzi Widoki Czynność
0
mar 23
1723
1
lis 19
4906
2
lis 18
5150
1
lip 17
14483
1
gru 16
7819