Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
14416 Представления

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.

Related Posts Ответы Просмотры Активность
0
мар. 23
1793
1
нояб. 19
5007
2
нояб. 18
5200
1
июл. 17
14571
1
дек. 16
7882