Skip to Content
Menu
This question has been flagged
2 Replies
1191 Views

Hello, I want to hide sales in the sale.view_quotation_tree_with_onboarding.


For example, we have groups A, B and C, each group is a type of sale, so if employee 1 belongs to group A and C he can see the sales type A and C but no B, all the B sales must be hidden to him.


I have try with Rules but I don't succed, also with invisible fields but it leaves a white line and I don't need that.

I thought that a filter should do it but it must be done automatically and I don't have any idea on how to do that

So, if anyone could help with this issue or have any idea I would be very grateful (:

Ty for reading




Avatar
Discard
Best Answer

why not to try showing only '-own document?

Avatar
Discard
Best Answer

hi

try to make groups for each sale Type , like privilage A, B and C, those privilages refers to sale kind.
now in python  code try this :

 def _get_user_groups(self):        
        if user.has_group('group_A'):  self.has_group_A = True         if user.has_group('group_B'):  self.has_group_B = True        
        if user.has_group('group_C'): self.has_group_C = True

so now you make boolean fields named like your groups in your python code like this:

has_group_A = fields.Boolean(compute = _get_user_groups)
has_group_B = fields.Boolean(compute = _get_user_groups) has_group_C = fields.Boolean(compute = _get_user_groups)

now you use those fields in your XML file by put them invisible ( to compute them each time a user go to that view),

and now put the invisible tag in each sale order to check if the user has those groups to see or not.
Note that when you make groups don't inherit previous group privilage, make every group by it's own.

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
185
2
Mar 24
698
2
Mar 24
1331
0
Sep 23
354
1
Sep 23
461