Odoo Help

4

1
4 Answers
1
Avatar

Jérémy Kersten (jke) Belgium

--Jérémy Kersten (jke)--

6373
| 4 4 11
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013.

He is now the Team Leader of the Website Team and support of our own website odoo.com.

Jérémy Kersten (jke) Belgium
2/8/16, 2:38 AM

Hello, sudo take a user id and not partner id... That Will not Fix your problem, but the next one:)


You can try to maka sudo after .order : self.order.sudo().

Because self is a Testnotification ... But sudo is a function on class Model


if it doesn't work, provide more codes. 

1 Comment
Atte Isopuro Finland
2/8/16, 8:38 AM

Right. *facepalm*. The part about using .sudo() on .order is also correct. Thank you.

0
Martin Pishpecki Netherlands
5/29/19, 9:51 AM

Headline says "How can I change the user permissions". 

For example quick adding user to purchase manager group:

self.user_a.groups_id += self.env.ref('purchase.group_purchase_manager')
Switch user executing the tests
self.env.uid = self.env.ref('account_invoice_inter_company.user_company_a').id
0

What about if I am testing a query ? Many multicompany entities use the user's company to filter.

As long as I see here the user is applied to the resulting objects., but these objects would be others using the new user.

Ask a Question
Writer
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

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

Test it now