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

Set Sales Margin visibility only for users with Sales Manager Permissions?

By
Sam Martin
on 8/18/16, 10:51 AM 219 views

Hi All, 

I have deployed Odoo 9 Community Edition on my own server and am working through configuring everything we need.  So far, so good, however my sales manager wants to set visibility of the margin on quotations and reports to be visible only to users given the Sales Manager role.

Is this possible?  I've noticed that there are a lot of useful looking capabilities under the developer mode view --> Access Controls List

I'm wondering if its possible to use that to restrict visibility of the margin data by role?

Specifically, we have (currently just 1) users with 'Sales Manager' set on their access rights, which should be the only people to see margin fields on quotations and reports.

The setting to turn margins on currently, (from Sales-->Configuration-->Settings-->Margins) is binary, either everyone can see the margins (which is not what we want), or no-one can see them (also not what we want!).

Let me know if there is any other information I can provide!

0
Sam Martin
On 8/19/16, 6:51 AM

I figured it out. The code to support margin display in quotations and sales reports is held in: addons/sale_margin


In there is a sale_margin_view.xml, which defines the fields in various parts of the user interface.  By default this view sets visibility to the user group, which is all Odoo users.  Adjusting this to `base.group_sale_manager` and restarting odoo resulted in the margin fields only being displayed when logged in with a user who is a member of the sales manager group (has the manager permission in their user access settings).


Hopefully this is helpful to others that get here.


Useful references:

https://www.odoo.com/documentation/9.0/reference/views.html

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: 8/18/16, 10:51 AM
Seen: 219 times
Last updated: 8/19/16, 6:51 AM