Odoo Help

Welcome!

This community 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.

0

Adding accounting tab of product.form to a group in v7?

By
Sean Samborski
on 7/16/14, 2:57 AM 894 views

I need to give access to users to view and edit the product accounts in the accounting tab on product.form. I have created the group with access rights account.account and account.type. I have added the following views:

  1. product.normal.form.inherit
  2. product.normal.form.return
  3. product.normal.form.return
  4. product.template.product.form.inherit
  5. product.template.stock.property.form.inherit

These are the only views I can find with accounting properties. Regardless, my users cannot view the accounting tab on the product form. What do I need to add to the group in order to see this tab?

 

EDIT: Well I just found out that adding the views to the group doesn't just give that group access, it also REMOVES access to everyone else. That seems counterproductive in an add state. You can't add without removing? Not a good design. That aside, I guess I have to find another way to add this accounting tab to a group.

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 7/16/14, 4:56 AM

On the tab XML view, you can use the groups-attribute. That hides the tab for anyone not in the specified group and is often used on buttons throughout Odoo. The syntax is as follows:

<field name="company_id" groups="base.group_multi_company"/>

This will hide the company_id field for anyone not in the multi-company group. You should check if that is the case on any of the views you mentioned.

Ok. I do see that on the accounting code. Is it possible to do an addition or is it only one? Ie can I add my group to that line without removing the old one?

Elephante, Sean Samborski
on 7/16/14, 12:48 PM

How do you find the right name for the group? I see the ID for my group, but the view is calling group groups="account.group_account_user". I can only assume that is the Accountant group as they are the only default group allowed to view this tab, but I do not know how to get that name for the group I've created.

Elephante, Sean Samborski
on 7/16/14, 1:25 PM

Alright, first things first. In your custom modules you should only be able to override the entire "groups-attribute". So instead of adding groups, you create the entire definition again. Secondly, when trying to identify groups head over to the code for the account module. Find the directory named "security". Inside that there should be an XML file which contains the group names as well as their ID. In my case I found a record with the name tag "Accountant" and the XML-ID being "group_account_user". You can use that in your case. Note: In most cases you need the dot-notation to distinguish the difference in modules. So groups should become something like groups="account.group_account_user", where account is the module that you found the group definition in.

Ludo - Neobis
on 7/17/14, 3:26 AM

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/16/14, 2:57 AM
Seen: 894 times
Last updated: 3/16/15, 8:10 AM