[IMP] exp_official_mission: adjust approval process

This commit is contained in:
Abdurrahman Saber 2025-11-01 13:18:29 +02:00
parent d06e689491
commit 776336b0e2
1 changed files with 3 additions and 1 deletions

View File

@ -564,6 +564,7 @@ class HrOfficialMission(models.Model):
def accounting_manager(self): def accounting_manager(self):
# self.chick_employee_ids() # self.chick_employee_ids()
self = self.sudo()
self.employee_ids.chick_not_overtime() self.employee_ids.chick_not_overtime()
self.employee_ids.compute_Training_cost_emp() self.employee_ids.compute_Training_cost_emp()
self.employee_ids.write({'status': 'approved'}) self.employee_ids.write({'status': 'approved'})
@ -573,7 +574,7 @@ class HrOfficialMission(models.Model):
def accounting_manager_refused(self): def accounting_manager_refused(self):
for rec in self: for rec in self:
rec.refused() rec.sudo().refused()
# Refuse For The Direct Manager Only # Refuse For The Direct Manager Only
def direct_manager_refused(self): def direct_manager_refused(self):
@ -641,6 +642,7 @@ class HrOfficialMission(models.Model):
def approve(self): def approve(self):
# check if there is dealing with financial # check if there is dealing with financial
self = self.sudo()
self.employee_ids.chick_not_overtime() self.employee_ids.chick_not_overtime()
if self.employee_ids and self.mission_type.related_with_financial: if self.employee_ids and self.mission_type.related_with_financial:
# move amounts to journal entries # move amounts to journal entries