Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7375 Lượt xem
# -*- 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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 23
1305
1
thg 8 19
2819
0
thg 3 15
3023
0
thg 10 24
741
0
thg 12 22
1553