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

Hello,


I want to limit what the user can see according to field.


Like for example there is a field called system (where we choose this form is for which part of the system: sale - quality etc...). If the user is working in the quality he will choose in the field quality and can see only the forms related to quality. the same for other parts.


May anyone help in doing this.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Hi Mehjabin,

I want to make the whole form invisible if the user working in quality and the form is about sales not the field.

Is there any other solution? Thanks for helping!
Waiting for your reply!!

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Asma,

I think using attrs=invisible you can solve this issue. Suppose your field system is defined as this:

system = fields.Selection([
('sale', 'Sales'),
('quality', 'Quality'),
], 'System', default='sale')

Also if the field for system="Quality" is field_quality and for system="Sales" is field_sale, then try as this:

<group>
<field name="field_sale" attrs="{'invisible': [('system','!=','sale')]}"/>
 <field name="field_quality" attrs="{'invisible': [('system','!=','quality')]}"/>
</group>


Check this video for further reference:https://www.youtube.com/watch?v=Ah00x69vVe4

Hope this will help you

Thank you

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 25
4154
2
lut 22
8902
Many2many fields Rozwiązane
2
mar 23
3704
1
maj 22
2886
1
kwi 24
1776