summaryrefslogtreecommitdiff
path: root/addons/sale_timesheet/security
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_timesheet/security
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_timesheet/security')
-rw-r--r--addons/sale_timesheet/security/ir.model.access.csv8
-rw-r--r--addons/sale_timesheet/security/sale_timesheet_security.xml15
2 files changed, 23 insertions, 0 deletions
diff --git a/addons/sale_timesheet/security/ir.model.access.csv b/addons/sale_timesheet/security/ir.model.access.csv
new file mode 100644
index 00000000..a391d661
--- /dev/null
+++ b/addons/sale_timesheet/security/ir.model.access.csv
@@ -0,0 +1,8 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_project_profitability_report_analysis_manager,project.profitability.report.analysis,model_project_profitability_report,project.group_project_manager,1,1,1,1
+access_project_sale_line_employee_map,access_project_sale_line_employee_map,model_project_sale_line_employee_map,base.group_user,1,0,0,0
+access_project_sale_line_employee_map_manager,access_project_sale_line_employee_map_project_manager,model_project_sale_line_employee_map,project.group_project_manager,1,1,1,1
+access_project_create_sale_order,access.project.create.sale.order,model_project_create_sale_order,sales_team.group_sale_salesman,1,1,1,0
+access_project_create_sale_order_line,access.project.create.sale.order.line,model_project_create_sale_order_line,sales_team.group_sale_salesman,1,1,1,1
+access_project_create_invoice,access.project.create.invoice,model_project_create_invoice,sales_team.group_sale_salesman_all_leads,1,1,1,0
+access_project_task_create_sale_order,access.project.task.create.sale.order,model_project_task_create_sale_order,sales_team.group_sale_salesman,1,1,1,0
diff --git a/addons/sale_timesheet/security/sale_timesheet_security.xml b/addons/sale_timesheet/security/sale_timesheet_security.xml
new file mode 100644
index 00000000..6da589d7
--- /dev/null
+++ b/addons/sale_timesheet/security/sale_timesheet_security.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo noupdate="1">
+
+
+ <!-- Override this rule because in hr_timesheet,
+ the lowest access right can only see own timesheets (model: account.analytic.line)
+ and this ir.rule accept all account.analytic.line in its domain.
+ Therefore, we need to override this rule to change the domain, and then the
+ rules for the account.analytic.line defined in timesheet will be apply.
+ -->
+ <record id="account.account_analytic_line_rule_billing_user" model="ir.rule">
+ <field name="domain_force">[('project_id', '=', False)]</field>
+ </record>
+
+</odoo>