コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7338 ビュー
# -*- 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

アバター
破棄
最善の回答

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

アバター
破棄
最善の回答

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 :)

アバター
破棄
関連投稿 返信 ビュー 活動
0
8月 23
1265
1
8月 19
2799
0
3月 15
2994
0
10月 24
723
0
12月 22
1522