Skip to Content
Menú
This question has been flagged
3 Respostes
10995 Vistes

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
Descartar

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)

Autor

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
Descartar
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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
1
de des. 22
4103
1
de febr. 22
4313
2
de març 24
3091
7
de març 21
67980
0
d’oct. 17
4686