diff --git a/fastapi_auth_partner/models/res_partner.py b/fastapi_auth_partner/models/res_partner.py index 2be05aa7..58317f27 100644 --- a/fastapi_auth_partner/models/res_partner.py +++ b/fastapi_auth_partner/models/res_partner.py @@ -13,7 +13,9 @@ class ResPartner(models.Model): auth_partner_ids = fields.One2many( "fastapi.auth.partner", "partner_id", "Partner Auth" ) - count_partner_auth = fields.Integer(compute="_compute_count_partner_auth") + count_partner_auth = fields.Integer( + compute="_compute_count_partner_auth", compute_sudo=True + ) def _compute_count_partner_auth(self): data = self.env["fastapi.auth.partner"].read_group( diff --git a/fastapi_auth_partner/views/res_partner_view.xml b/fastapi_auth_partner/views/res_partner_view.xml index 4c237552..5006f17a 100644 --- a/fastapi_auth_partner/views/res_partner_view.xml +++ b/fastapi_auth_partner/views/res_partner_view.xml @@ -11,6 +11,7 @@ name="%(fastapi_auth_partner_action)d" icon="fa-user" type="action" + groups="fastapi_auth_partner.group_partner_auth_manager" context="{'search_default_partner_id': active_id}" >