fix compted

This commit is contained in:
mohammed-alkhazrji 2025-12-15 00:12:36 +03:00
parent e0d10bb8c9
commit 205dd61706
2 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,7 @@ class Transaction(models.Model):
for rec in self:
if rec.to_ids:
employee_id = rec.to_ids[0].id
rec.receive_id = False
if rec.to_ids[0].type == 'unit':
employee_id = rec.to_ids[0].secretary_id.id
rec.receive_id = employee_id

View File

@ -212,6 +212,9 @@ class Transaction(models.Model):
def compute_receive_id(self):
for rec in self:
rec.receive_id = False
rec.to_user_have_leave = False
rec.receive_user_id = False
employee_id, unit_id = self.get_employee_id(rec)
rec.receive_id = employee_id
rec.receive_user_id = rec.receive_id.user_id