Skip to Content
Menu
This question has been flagged
1 Reply
2215 Views

I'm a newbie in Odoo, and my mother tongue isn't English, so sorry if my question isn't understandable.

I have some problems with search() function:

I'm trying to set a conditions to check automical name what I compute for a model. It's not something like _sql_constraints and @api.constrains. And I write function below to check all exist names in my DB to know wheather the automatical computed name is exist. And it works, but...

self.env["lop_hanh_chinh"].search([("ten_lop_hanh_chinh", "ilike", temp)])

When I login a Administrator account, I can find the record I need.

But when I login a Officer account (have access to a subset of records), I can not find what I need.

I have faced to this problem once, and I think it's related to self.env['lop_hanh_chinh'], but I have record rules for Officer!!!

Thanks!

Avatar
Discard

Can you share the record rule set for officer

Author Best Answer

            Quản trị viên hình thức đào tạo nào thì được xem lớp hành chính của hình thức đào tạo đó                                    [('hinh_thuc_dao_tao_id','=',user.hinh_thuc_dao_tao_id.id)]       

access_lop_hanh_chinh_quan_tri_vien,lop_hanh_chinh.quan_tri_vien,model_lop_hanh_chinh,website_slides.group_website_slides_officer,1,1,1,1

 

Avatar
Discard
Related Posts Replies Views Activity
2
Jan 24
3334
0
Jan 24
1586
1
Sep 21
18685
0
Dec 20
2146
1
Sep 19
4945