From 7694f012cdd668e3a1aa7710580d508fed460d4b Mon Sep 17 00:00:00 2001 From: prye-odoo Date: Wed, 7 Jun 2023 09:07:49 +0000 Subject: [PATCH] [FIX] *: handle unlink/create access for reporting views *: account,event_sale,fleet,hr_attendance,hr_contract,hr_timesheet, im_livechat,point_of_sale,project When the user tries to delete a record(s) from the reporting views, this traceback will be generated. Steps to produce (Example only): - Settings > Technical > Actions > Window Actions - Search for the Work Entries Analysis. Open it and add a 'tree' as view_mode in that action. - Payroll > Reporting > Work Entries Analysis menu and select the tree view. - Select one or more records and try to delete these records. Error: A traceback appears: "cannot delete from view "hr_work_entry_report" Handled the unlink access by using their model access of the reporting models. similarly, this issue resolves in other reporting models. Sentry-3975590063 closes odoo/odoo#125697 X-original-commit: 209d8c76ce9bb1d6cc7084d55b5623e939af8fbc Related: odoo/enterprise#42825 Signed-off-by: Nicolas Lempereur (nle) --- addons/account/security/ir.model.access.csv | 2 +- addons/event_sale/security/ir.model.access.csv | 2 +- addons/fleet/security/ir.model.access.csv | 2 +- addons/hr_attendance/security/ir.model.access.csv | 2 +- addons/hr_contract/security/ir.model.access.csv | 2 +- addons/hr_timesheet/security/ir.model.access.csv | 4 ++-- addons/im_livechat/security/ir.model.access.csv | 4 ++-- addons/point_of_sale/security/ir.model.access.csv | 2 +- addons/project/security/ir.model.access.csv | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index b68fd6c6cb2..9bbe18ad3d2 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -8,7 +8,7 @@ access_res_currency_rate_account_manager,res.currency.rate account manager,base. access_account_invoice_report_readonly,account.invoice.report_user,model_account_invoice_report,account.group_account_readonly,1,0,0,0 access_account_invoice_report_billing,account.invoice.report_billing,model_account_invoice_report,account.group_account_invoice,1,0,0,0 -access_account_invoice_report,account.invoice.report,model_account_invoice_report,account.group_account_manager,1,1,1,1 +access_account_invoice_report,account.invoice.report,model_account_invoice_report,account.group_account_manager,1,0,0,0 access_account_incoterms_all,account.incoterms all,model_account_incoterms,base.group_user,1,0,0,0 access_account_incoterms_manager,account.incoterms manager,model_account_incoterms,account.group_account_manager,1,1,1,1 diff --git a/addons/event_sale/security/ir.model.access.csv b/addons/event_sale/security/ir.model.access.csv index 7d72b912e5b..667f72b70fe 100644 --- a/addons/event_sale/security/ir.model.access.csv +++ b/addons/event_sale/security/ir.model.access.csv @@ -4,4 +4,4 @@ access_product_product_event_manager,product.product.event.manager,product.model access_registration_editor,access.registration.editor,model_registration_editor,sales_team.group_sale_salesman,1,1,1,0 access_registration_editor_line,access.registration.editor.line,model_registration_editor_line,sales_team.group_sale_salesman,1,1,1,1 access_event_event_configurator,access.event.event.configurator,model_event_event_configurator,sales_team.group_sale_salesman,1,1,1,0 -access_event_sale_report_manager,access.event.sale.report.manager,model_event_sale_report,event.group_event_manager,1,1,1,1 +access_event_sale_report_manager,access.event.sale.report.manager,model_event_sale_report,event.group_event_manager,1,0,0,0 diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index 273322f89e2..3cf76e174bf 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -20,4 +20,4 @@ fleet_vehicle_log_contract_access_right,fleet_vehicle_log_contract_access_right, fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,fleet_group_manager,1,1,1,1 access_mail_activity_type_fleet_manager,mail.activity.type.fleet.manager,mail.model_mail_activity_type,fleet.fleet_group_manager,1,1,1,1 access_fleet_vehicle_assignation_log_fleet_group_user,fleet_vehicle_assignation_log fleet_group_user,fleet.model_fleet_vehicle_assignation_log,fleet.fleet_group_user,1,1,1,1 -access_fleet_report_manager,fleet_vehicle_cost_report_access_right,model_fleet_vehicle_cost_report,fleet_group_manager,1,1,1,1 +access_fleet_report_manager,fleet_vehicle_cost_report_access_right,model_fleet_vehicle_cost_report,fleet_group_manager,1,0,0,0 diff --git a/addons/hr_attendance/security/ir.model.access.csv b/addons/hr_attendance/security/ir.model.access.csv index b287bc4f98d..55e17240e12 100644 --- a/addons/hr_attendance/security/ir.model.access.csv +++ b/addons/hr_attendance/security/ir.model.access.csv @@ -4,4 +4,4 @@ access_hr_attendance_user,hr.attendance.system.user,model_hr_attendance,group_hr access_hr_attendance_system_user,hr.attendance.system.user,model_hr_attendance,base.group_user,1,0,0,0 access_hr_attendance_overtime_user,hr.attendance.overtime.user,model_hr_attendance_overtime,hr_attendance.group_hr_attendance_user,1,1,1,1 access_hr_attendance_overtime_system_user,hr.attendance.overtime.system.user,model_hr_attendance_overtime,base.group_user,1,0,0,0 -access_hr_attendance_report_user,hr.attendance.report.user,model_hr_attendance_report,hr_attendance.group_hr_attendance_user,1,1,1,1 +access_hr_attendance_report_user,hr.attendance.report.user,model_hr_attendance_report,hr_attendance.group_hr_attendance_user,1,0,0,0 diff --git a/addons/hr_contract/security/ir.model.access.csv b/addons/hr_contract/security/ir.model.access.csv index 49544b240bb..bddc742df34 100644 --- a/addons/hr_contract/security/ir.model.access.csv +++ b/addons/hr_contract/security/ir.model.access.csv @@ -3,6 +3,6 @@ access_hr_resource_manager,hr.employee.resource.manager,resource.model_resource_ access_hr_resource_calendar_user,hr.employee.resource.calendar.user,resource.model_resource_calendar,hr.group_hr_user,1,1,1,1 access_hr_resource_calendar_attendance_user,hr.employee.resource.calendar.attendance.user,resource.model_resource_calendar_attendance,hr.group_hr_user,1,1,1,1 access_hr_contract_manager,hr.contract.manager,model_hr_contract,hr_contract.group_hr_contract_manager,1,1,1,1 -access_hr_contract_history_manager,hr.contract.history.manager,model_hr_contract_history,hr_contract.group_hr_contract_manager,1,1,1,1 +access_hr_contract_history_manager,hr.contract.history.manager,model_hr_contract_history,hr_contract.group_hr_contract_manager,1,0,0,0 access_hr_payroll_structure_type_hr_contract_manager,hr.payroll.structure.type.contract.manager,model_hr_payroll_structure_type,hr_contract.group_hr_contract_manager,1,1,1,1 access_hr_contract_hr_employee_manager,hr.contract.hr.employee.manager,model_hr_contract,hr_contract.group_hr_contract_employee_manager,1,0,0,0 diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv index 510c5138597..58a4d9e6e7c 100644 --- a/addons/hr_timesheet/security/ir.model.access.csv +++ b/addons/hr_timesheet/security/ir.model.access.csv @@ -4,6 +4,6 @@ access_account_analytic_user,analytic.account.analytic.timesheet.user,analytic.m access_uom_uom_hr_timesheet,uom.uom.timesheet.user,uom.model_uom_uom,hr_timesheet.group_hr_timesheet_user,1,0,0,0 access_project_project,project.project.timesheet.user,model_project_project,hr_timesheet.group_hr_timesheet_user,1,0,0,0 access_project_task,project.task.timesheet.user,model_project_task,hr_timesheet.group_hr_timesheet_user,1,1,0,0 -access_timesheets_analysis_report_manager,timesheets.analysis.report,model_timesheets_analysis_report,hr_timesheet.group_timesheet_manager,1,1,1,1 -access_timesheets_analysis_report_user,timesheets.analysis.report,model_timesheets_analysis_report,hr_timesheet.group_hr_timesheet_user,1,0,1,0 +access_timesheets_analysis_report_manager,timesheets.analysis.report,model_timesheets_analysis_report,hr_timesheet.group_timesheet_manager,1,0,0,0 +access_timesheets_analysis_report_user,timesheets.analysis.report,model_timesheets_analysis_report,hr_timesheet.group_hr_timesheet_user,1,0,0,0 access_hr_employee_delete_wizard,hr.employee.delete.wizard,model_hr_employee_delete_wizard,hr.group_hr_user,1,1,1,0 diff --git a/addons/im_livechat/security/ir.model.access.csv b/addons/im_livechat/security/ir.model.access.csv index 8a0717a353e..e40558ad16d 100644 --- a/addons/im_livechat/security/ir.model.access.csv +++ b/addons/im_livechat/security/ir.model.access.csv @@ -2,8 +2,8 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_livechat_channel,im_livechat.channel,model_im_livechat_channel,,1,0,0,0 access_livechat_channel_user,im_livechat.channel.user,model_im_livechat_channel,im_livechat_group_user,1,1,1,0 access_livechat_channel_manager,im_livechat.channel.manager,model_im_livechat_channel,im_livechat_group_manager,1,1,1,1 -access_livechat_support_report_channel,im_livechat.report.channel,model_im_livechat_report_channel,im_livechat_group_manager,1,1,1,1 -access_livechat_support_report_operator,im_livechat.report.operator,model_im_livechat_report_operator,im_livechat_group_manager,1,1,1,1 +access_livechat_support_report_channel,im_livechat.report.channel,model_im_livechat_report_channel,im_livechat_group_manager,1,0,0,0 +access_livechat_support_report_operator,im_livechat.report.operator,model_im_livechat_report_operator,im_livechat_group_manager,1,0,0,0 access_livechat_channel_rule,im_livechat.channel.rule,model_im_livechat_channel_rule,,1,0,0,0 access_livechat_channel_rule_user,im_livechat.channel.rule,model_im_livechat_channel_rule,im_livechat_group_user,1,1,1,0 access_livechat_channel_rule_manager,im_livechat.channel.rule,model_im_livechat_channel_rule,im_livechat_group_manager,1,1,1,1 diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv index 5716eababfa..41b5594da75 100644 --- a/addons/point_of_sale/security/ir.model.access.csv +++ b/addons/point_of_sale/security/ir.model.access.csv @@ -8,7 +8,7 @@ access_stock_picking_pos_user,stock.picking pos_user,stock.model_stock_picking,g access_stock_warehouse_pos_user,stock.warehouse pos_user,stock.model_stock_warehouse,group_pos_user,1,0,0,0 access_pos_order_stock_worker,pos.order stock_worker,model_pos_order,stock.group_stock_user,1,0,0,0 access_stock_move_pos_user,stock.move pos_user,stock.model_stock_move,group_pos_user,1,1,1,1 -access_report_pos_order,report.pos.order,model_report_pos_order,group_pos_user,1,1,1,1 +access_report_pos_order,report.pos.order,model_report_pos_order,group_pos_user,1,0,0,0 access_account_journal_pos_user,account.journal pos_user,account.model_account_journal,group_pos_user,1,0,0,0 access_account_payment_method_pos_user,account.payment.method pos_user,account.model_account_payment_method,group_pos_manager,1,0,0,0 access_account_payment_method_line_pos_user,account.payment.method.line pos_user,account.model_account_payment_method_line,group_pos_manager,1,0,0,0 diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index 4034c35fc48..a32781be6a1 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -8,7 +8,7 @@ access_project_task_type_project_user,project.task.type.project.user,model_proje access_project_task_type_manager,project.task.type manager,model_project_task_type,project.group_project_manager,1,1,1,1 access_project_task_type_portal,task_type_portal,project.model_project_task_type,base.group_portal,1,0,0,0 access_project_task,project.task,model_project_task,project.group_project_user,1,1,1,1 -access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,1,1,1 +access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,0,0,0 access_report_project_task_user_project_user,report.project.task.user.project.user,model_report_project_task_user,project.group_project_user,1,0,0,0 access_partner_task_user,base.res.partner user,base.model_res_partner,project.group_project_user,1,0,0,0 access_task_on_partner,project.task on partners,model_project_task,base.group_user,1,0,0,0