From 308bbac2e640628fd41f74fc944b593ad0822f9f Mon Sep 17 00:00:00 2001 From: younes Date: Mon, 20 Oct 2025 08:59:45 +0100 Subject: [PATCH] [IMP] odex_benefit: Add Researcher Supervisor security group and related record rules for Family Member --- odex25_ensan/odex_benefit/i18n/ar_001.po | 5 ++ .../odex_benefit/models/service_request.py | 10 ---- .../odex_benefit/security/security_view.xml | 50 +++++++++++++++++-- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/odex25_ensan/odex_benefit/i18n/ar_001.po b/odex25_ensan/odex_benefit/i18n/ar_001.po index 6f97ba9e8..660766127 100644 --- a/odex25_ensan/odex_benefit/i18n/ar_001.po +++ b/odex25_ensan/odex_benefit/i18n/ar_001.po @@ -16488,3 +16488,8 @@ msgstr "اعتماد إدارة المشاريع" msgid "Beneficiary Approve" msgstr "اعتماد مساعد المدير العام" +#. module: odex_benefit +#: model:res.groups,name:odex_benefit.group_benefit_supervisor +msgid "Researcher Supervisor" +msgstr "مشرف الأخصائي" + diff --git a/odex25_ensan/odex_benefit/models/service_request.py b/odex25_ensan/odex_benefit/models/service_request.py index afbf94780..392df0d07 100644 --- a/odex25_ensan/odex_benefit/models/service_request.py +++ b/odex25_ensan/odex_benefit/models/service_request.py @@ -233,16 +233,6 @@ class ServiceRequest(models.Model): rec.attachment_lines = commands - @api.model - def search(self, args, offset=0, limit=None, order=None, count=False): - if self.env.user and self.env.user.id and self.env.user.has_group("odex_benefit.group_benefit_accountant_accept")\ - and not self.env.user.has_group("odex_benefit.group_benefit_payment_accountant_accept") : - args += [('accountant_id', '=', self.env.user.id)] - if self.env.user and self.env.user.id and self.env.user.has_group("odex_benefit.group_benefit_accountant_accept")\ - and self.env.user.has_group("odex_benefit.group_benefit_payment_accountant_accept") : - args += [] - return super(ServiceRequest, self).search(args, offset, limit, order, count) - @api.model def create(self, vals): # Define the list of fields to check diff --git a/odex25_ensan/odex_benefit/security/security_view.xml b/odex25_ensan/odex_benefit/security/security_view.xml index 130415a4b..b123f7b35 100644 --- a/odex25_ensan/odex_benefit/security/security_view.xml +++ b/odex25_ensan/odex_benefit/security/security_view.xml @@ -64,6 +64,13 @@ + + Researcher Supervisor + + + + + Head of the Women's Committee @@ -143,7 +150,7 @@ Show All Benefits Profiles [(1, '=', 1)] - + @@ -176,7 +183,7 @@ Show All Visit Location [(1, '=', 1)] - + @@ -224,7 +231,7 @@ Show All Family Complaints [(1, '=', 1)] - + @@ -261,8 +268,8 @@ Show All Service Requests [(1, '=', 1)] - - + + @@ -296,5 +303,38 @@ [('service_cat.needs_legal_approval', '=', True)] + + + + Show All Family Members + + [(1, '=', 1)] + + + + + + Show Family Members of Own Branch + + [('benefit_id.branch_custom_id.branch.manager_id', '=', user.employee_id.id)] + + + + + + Show Family Members of Assigned Branch (Operations Manager) + + [('benefit_id.branch_custom_id.branch.operation_manager_id', '=', user.employee_id.id)] + + + + + + Show Family Members Created or Assigned (Researcher) + + ['|', ('create_uid','=',user.id),('benefit_id.researcher_id.employee_id', 'in', user.employee_id.ids)] + + +