Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How to allow portal users to see account.analytic.lines which belong to account.analytic.accounts which are associated with their partner_id?
I'd like to give customers the possibility to see all "their" account.analytic.lines when they log into the portal. I tried several approches but all faild so I'd like to know if there are any better/working solutions for this problem.
Here is what I've tried:
- Created a menu for account.analytic.line for portal users.
- Granted portal users read access to account.analytic.line (at this point all portal users could see all account.analytic.lines).
- Tried to set up a global record rule for account.analytic.line which looked something like this ['&', ('accout_id', '=', 'account.analytic.account.id'), ('account.analytic.account.id', user.partner_id.id)]. This did not work as it seems you only have access to the model in question (account.analytic.line) and the user but not other models (so the error said that account is undefined).
- Tried to set up specifc rules for each user I'd like to grant this access. This wouldn't be as nice as the previous outcome but I only have a few customers which are interested in something like that anyways. So I tried to set up a global rule like this ['&', (('accout_id', 'in', [233, 234, 240, 241])), (user.id, '=', 89)], where I manually would have changed the rule when I would have added other account.analytic.accounts for the user with the ID 89. But unfortunately this rule resulted in an error "invalid leaf (89, '=', 89)". Changing the syntax and position of the second satement did not help only removing it but then every user would be able to see account.analytic.lines from 89 which of course should not be the case.
Thanks for any tips regarding this! (If the only way is writing an extension it would be also nice if someone could point me in the right direction)
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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
|Asked: 9/19/14, 9:06 PM|
|Seen: 875 times|
|Last updated: 3/16/15, 8:10 AM|