Merge pull request #5728 from expsa/khazraji_transaction

fix compted
This commit is contained in:
mohammed-alkhazrji 2025-12-15 00:18:27 +03:00 committed by GitHub
commit ffdf8a181b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -212,6 +212,9 @@ class Transaction(models.Model):
def compute_receive_id(self): def compute_receive_id(self):
for rec in 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) employee_id, unit_id = self.get_employee_id(rec)
rec.receive_id = employee_id rec.receive_id = employee_id
rec.receive_user_id = rec.receive_id.user_id rec.receive_user_id = rec.receive_id.user_id