Skip to Content
Menu
This question has been flagged
3 Replies
9813 Views

How do I go about allowing Margin in Sales order to be displayed only to select group of users? I don't want every single person with access to the sales module to be able to see the margin in a sales.

Avatar
Discard

You can turn it off for everybody in the company by deticking Settings --> Configuration --> Sales --> Quotations and Sales Orders -- Sale Features -- Display margin on sales orders (I do not have enough "Karma" to post the screenshot unfortunately)

Author

Bumping this. Would really like to be able to allow sales margin to be seen by certain group only and not by the whole company.

Best Answer

I am not sure, but you might need to add access to: product.pricelist.type, product.pricelist.item, product.pricelist.version and product.price.type


It is a matter of figuring out which access rights are needed and adding those to a new custom group. I am just going based on analysis between the Sales / User and Sales / Manager access rights. To know what is required for sure, look at the source for the sale_margin module.

The module installer indicates you might need to grant access to these views:

Created Views

* INHERIT sale.order.line.margin.view.form (form)
* INHERIT sale.order.line.tree.margin.view.form (form)
* INHERIT sale.order.margin.view.form (form)

 

Avatar
Discard
Best Answer

Hi,

For this you can activate the feature of the margins from the Sales -> Configuration -> Settings, then in the pricing section you can see the option  to activate the Margins. Once it is activated the field will be visible for all the users who have access to the sales. As you want to restrict the visibility of the field to certain group of users, what you can do is that, activate the developer mode and click the Edit form view option from the debugger button near logged in users name in the menu bar from the sale order form view.

Inside the View Architecture page or in inherited views tab, you can see the corresponding field. From here you can add a groups tag to the field and specify the id of the group users, for which the field has to be displayed. Once this is done, the field will be visible only for the users under the specified group.

<field name="test" groups="external_id_of_group"/>

Thanks

Avatar
Discard
Best Answer

You need to extend the sales view form and add the group to the margin field xml tag. You can create a module to add  that functionality.

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 22
2522
1
Feb 22
2612
2
Mar 24
1814
7
Mar 21
65620
0
Oct 17
3712