Skip to content

Commit

Permalink
[IMP] sale_report_delivered: Allow salesman to have access to the sal…
Browse files Browse the repository at this point in the history
…e delivery report in the same way as they have access to the sales report.

TT51606
  • Loading branch information
pilarvargas-tecnativa committed Dec 5, 2024
1 parent d3f798a commit 3d1fbf0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sale_report_delivered/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
"installable": True,
"development_status": "Beta",
"maintainers": ["sergio-teruel"],
"data": ["security/ir.model.access.csv", "views/sale_report_delivered_views.xml"],
"data": [
"security/ir.model.access.csv",
"security/sale_report_security.xml",
"views/sale_report_delivered_views.xml",
],
}
1 change: 1 addition & 0 deletions sale_report_delivered/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_report_delivered_manager,sale.report.delivered,model_sale_report_delivered,sales_team.group_sale_manager,1,1,1,1
access_sale_report_delivered_salesman,sale.report.delivered,model_sale_report_delivered,sales_team.group_sale_salesman,1,0,0,0
21 changes: 21 additions & 0 deletions sale_report_delivered/security/sale_report_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="sale_report_delivered_personal_rule" model="ir.rule">
<field name="name">Personal Delivered Analysis</field>
<field name="model_id" ref="model_sale_report_delivered" />
<field
name="domain_force"
>['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]" />
</record>

<record id="sale_report_delivered_see_all_rule" model="ir.rule">
<field name="name">All Delivered Analysis</field>
<field name="model_id" ref="model_sale_report_delivered" />
<field name="domain_force">[(1, '=', 1)]</field>
<field
name="groups"
eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"
/>
</record>
</odoo>

0 comments on commit 3d1fbf0

Please sign in to comment.