Odoo Help


What is wrong with using (user.id,'=',3) in a record rule?

Pascal Tremblay
on 8/10/15, 2:20 PM 1,077 views

Hello there,

I want the public user (id3) see all products of all companies on front-end shop.

So I add something to the original rule :


But I get this error :


            Error message:

            Invalid leaf (8, '=', 3)

Somebody could help?

una alternativa [('create_uid','=',3)] or [('create_uid','=',user.id)]

Gustavo Hinojosa
on 5/11/16, 3:46 PM

Shawn Varghese

--Shawn Varghese--
| 5 3 7
Dubai, United Arab Emirates
--Shawn Varghese--

Shawn Varghese
On 8/10/15, 2:46 PM

I think that kind of assignation ('user.id','=',3) does not logically make sense, as the left side argument is normally a field or property that comes from the model, and the right side argument is the value you want to compare it to.

For example, if the model had a field, user_id, then you could use:

('user_id','=',3) or ('user_id','=',user.id) 


I don't know if this is a correct example, but your current record rule would be like trying to write a SQL query like:

select * from res_partner where 3=user_id

instead of:

select * from res_partner where user_id=3;

interesting. thank you. But how could I get the logged user in this rule of product.template?

Pascal Tremblay
on 8/10/15, 2:48 PM

Yea, I'm struggling with that as well. It would have been really useful - I'm still looking out for a solution. Sorry I couldn't help out on that.

ePillars Systems LLC, Shawn Varghese
on 8/10/15, 2:49 PM

Check out this post. You may be able to use the solution for your case: https://www.odoo.com/forum/help-1/question/how-to-filter-records-based-on-groups-26982

ePillars Systems LLC, Shawn Varghese
on 8/10/15, 2:52 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/10/15, 2:20 PM
Seen: 1077 times
Last updated: 8/10/15, 6:03 PM