diff --git a/odex25_takaful/odex_takaful/models/res_partner.py b/odex25_takaful/odex_takaful/models/res_partner.py
index 4167b994d..bb21ce779 100644
--- a/odex25_takaful/odex_takaful/models/res_partner.py
+++ b/odex25_takaful/odex_takaful/models/res_partner.py
@@ -135,6 +135,26 @@ class ResPartner(models.Model):
if is_family_or_beneficiary and is_donor_vendor_sponsor:
raise ValidationError(_("A contact cannot be both Family/Beneficiary and Donor/Member/Sponsor at the same time!"))
+ @api.model
+ def search(self, args, offset=0, limit=None, order=None, count=False):
+
+ if not self.env.context.get('from_contact_search'):
+ return super().search(args, offset=offset, limit=limit, order=order, count=count)
+
+ if self.env.context.get('mail_read') or self.env.context.get('mail_message_origin'):
+ return super().search(args, offset=offset, limit=limit, order=order, count=count)
+
+ base_results = super().search(args, offset=offset, limit=limit, order=order)
+
+ if not base_results:
+ return base_results
+
+ children = super().search([('parent_id', 'in', base_results.ids)])
+
+ final_ids = list(set(base_results.ids + children.ids))
+
+ return super().search([('id', 'in', final_ids)], offset=0, limit=limit, order=order, count=count)
+
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
if not args:
diff --git a/odex25_takaful/odex_takaful/security/security_data.xml b/odex25_takaful/odex_takaful/security/security_data.xml
index 6cd9e1484..d53169341 100644
--- a/odex25_takaful/odex_takaful/security/security_data.xml
+++ b/odex25_takaful/odex_takaful/security/security_data.xml
@@ -196,16 +196,7 @@
-
- Branch Manager can only see all his branch sponsorships and donations Lines
-
-
- [('branch_custom_id.branch.manager_id.user_id', 'in', [user.id, False])]
-
-
-
-
-
+