Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7488 Visualizzazioni
# -*- 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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ago 23
1389
1
ago 19
2926
0
mar 15
3106
0
ott 24
826
0
dic 22
1637