Skip to Content
Menu
This question has been flagged
2 Replies
7497 Zobrazenia
# -*- coding: utf-8 -*-

from odoo import api, fields, models


class DHAMSRFSTeam(models.Model):
_inherit = "sale.report"
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
dham_module_srfst_sa,view.sale.report,model_sale_report,sales_team.group_sale_salesman_all_leads,1,1,1,0
dham_module_srfst_sm,view.sale.report,model_sale_report,sales_team.group_sale_salesman,1,1,1,0

This code doesn't enable "Sales->Reports->Sales"  for user "User: Own Documents Only" and "User: All Documents".

I must use codes to enable it.

Thanks in advance

Avatar
Zrušiť
Best Answer

Hi,

For making the menu, Sales -> Reports -> Sales, visible for the users "User: Own Documents Only" and "User: All Documents", what you have to do is that you have to add this group to the menu.


It can be done either from the User interface or from the code.

From Code:

create a xml file and add this code.

<record model="ir.ui.menu" id="sales_team.menu_sale_report">
<field eval="[(4, ref('sales_team.group_sale_salesman'))]" name="groups_id"/>
</record>


From the UI:

Activate the developer mode and navigate to Settings -> Technical -> User Interface -> Menu Items, then search the corresponding menu, ie, Reports menu and open it and in the Access Rights tab add the group.




Thanks

Avatar
Zrušiť
Best Answer

Just as a follow up to @Cybrosys Techno Solutions Pvt.Ltd's answer, the UI method (2nd method) provided works great on Odoo 12!

To clarify: if you enable access rights to the 'Reporting' Menu for 'User: Own documents only', they will also only be able to see their own sales in the 'reporting tab'. I.e. if you're worried people will be able to see the sales data for other users, this is not the case :)

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
aug 23
1389
1
aug 19
2930
0
mar 15
3107
0
okt 24
828
0
dec 22
1639