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

i want to make list view base on custom object 'wtc.approval.line', one of its field has one2many relation to 'res.groups' .

i just want to filter list view by current user login that has a group in that object. for example i login as administrator , administrator has group 'Purchase/Manager' in 'wtc.approval.line' , so in list view the administrator only saw his group not the others . My xml code shown below :

        <record model="ir.actions.act_window" id="approval_portal_action">
            <field name="name">Portal Approval Matrix Biaya</field>
            <field name="res_model">wtc.approval.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="context">{'group_id':active_id}</field>
            <field name="domain">[('sts','=','1')]</field>
        </record>

any idea?

Аватар
Отменить
Автор

do i have to use domain ? as well as 'sts' ?

Лучший ответ

You need to write Security Record Rules to achieve the same... Refer Standard modules, how rules are defined for an object and user

Аватар
Отменить
Автор

anyway in Record Rules , do i have to define a new method to get user groups id ?