Merge pull request #4366 from expsa/Jaz-3691

Jaz 3691
This commit is contained in:
abdurrahman-saber 2025-08-28 14:07:15 +03:00 committed by GitHub
commit 875f0f56a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -49,15 +49,16 @@ class AccountAssetOperation(models.Model):
# self.asset_id.purpose = self.note
class HrEmployee(models.Model):
_inherit = 'hr.employee'
petty_cash_count1 = fields.Integer(compute='assignment_no')
assignment_no = fields.Integer(compute='_compute_assignment_no')
def assignment_no(self):
petty_cash_count1 = fields.Integer(compute='_compute_assignment_no')
def _compute_assignment_no(self):
for emp in self:
items = self.env['account.asset.operation'].search([
items = self.env['account.asset.operation'].sudo().search([
('asset_statuso','=','assigned'),('new_employee_id', '=',self.id )
])
emp.petty_cash_count1 = len(items)
# emp.user_id.partner_id.id
def get_assignment(self):
self.ensure_one()
return {