Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
7388 Weergaven
# -*- 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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 23
1313
1
aug. 19
2826
0
mrt. 15
3032
0
okt. 24
745
0
dec. 22
1558