Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2199 Vistas

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
Descartar

Can you share the record rule set for officer

Autor Mejor respuesta

            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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
ene 24
3293
0
ene 24
1582
1
sept 21
18641
0
dic 20
2134
1
sept 19
4921