Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
10996 Tampilan

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
Buang

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)

Penulis

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.

Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Des 22
4103
1
Feb 22
4314
2
Mar 24
3091
7
Mar 21
67980
0
Okt 17
4686