Merge pull request #4484 from expsa/Jaz-3691

[FIX] hr_expense_petty_cash: access
This commit is contained in:
abdurrahman-saber 2025-09-01 09:16:59 +03:00 committed by GitHub
commit e2ee2bbc43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,7 @@ class HrEmployee(models.Model):
petty_cash_count = fields.Integer(compute='_compute_petty_cash_count')
def _compute_petty_cash_count(self):
for emp in self:
items = self.env['petty.cash'].search([
items = self.env['petty.cash'].sudo().search([
('partner_id', '=', emp.user_id.partner_id.id),
])
emp.petty_cash_count = len(items)