Merge pull request #3608 from expsa/attendence_total_hou
Attendence total hou
This commit is contained in:
commit
862401d8b7
|
|
@ -93,17 +93,12 @@ class EmployeeOtherRequest(models.Model):
|
|||
if item.request_type == 'dependent':
|
||||
if not item.employee_dependant:
|
||||
raise exceptions.Warning(_('Please The dependents were not Included'))
|
||||
#if item.employee_id.contract_id.contract_status == 'single':
|
||||
#raise exceptions.Warning(_('You can not Add Fimaly record Because Employee is Single'))
|
||||
# if item.employee_id.contract_id.contract_status == 'single':
|
||||
# raise exceptions.Warning(_('You can not Add Fimaly record Because Employee is Single'))
|
||||
else:
|
||||
for rec in item.employee_dependant:
|
||||
if not rec.attachment:
|
||||
raise exceptions.Warning(_('Please Insert dependents Attachments Files Below!'))
|
||||
|
||||
|
||||
item.state = "submit"
|
||||
|
||||
|
||||
if not rec.attachment:
|
||||
raise exceptions.Warning(_('Please Insert dependents Attachments Files Below!'))
|
||||
|
||||
if item.request_type == 'qualification':
|
||||
if not item.qualification_employee:
|
||||
|
|
@ -111,22 +106,18 @@ class EmployeeOtherRequest(models.Model):
|
|||
for rec in item.qualification_employee:
|
||||
if not rec.attachment:
|
||||
raise exceptions.Warning(_('Please Insert Attachments Files Below!'))
|
||||
else:
|
||||
item.state = "submit"
|
||||
|
||||
if item.request_type == 'certification':
|
||||
if not item.certification_employee:
|
||||
raise exceptions.Warning(_('Please The qualification or certification were not Insert Below!'))
|
||||
for rec in item.certification_employee:
|
||||
if not rec.attachment:
|
||||
raise exceptions.Warning(_('Please Insert Attachments Files Below!'))
|
||||
else:
|
||||
item.state = "submit"
|
||||
|
||||
if item.request_type in ['suggestion', 'complaint']:
|
||||
item.state = "submit"
|
||||
else:
|
||||
if item.request_type in ['suggestion', 'complaint']:
|
||||
item.state = "submit"
|
||||
else:
|
||||
item.state = "confirm"
|
||||
item.state = "confirm"
|
||||
|
||||
def confirm(self):
|
||||
#self.state = 'confirm'
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ class StandardAppraisalLines(models.Model):
|
|||
_name = 'standard.appraisal.line'
|
||||
_rec_name = 'greed'
|
||||
_description = 'Standard Appraisal line'
|
||||
standard_appraisal_employee_line = fields.Many2one('hr.employee.appraisal')
|
||||
|
||||
greed = fields.Float()
|
||||
accrued_greed = fields.Float()
|
||||
|
|
@ -269,50 +270,45 @@ class StandardAppraisalLines(models.Model):
|
|||
('3', '3'),
|
||||
('4', '4'),
|
||||
('5', '5'),
|
||||
('6', '6'),
|
||||
# ('6', '6'),
|
||||
],
|
||||
string='Priority',
|
||||
compute='_compute_priority',
|
||||
inverse='_inverse_priority',
|
||||
|
||||
store=True
|
||||
)
|
||||
|
||||
standard_appraisal_employee_line = fields.Many2one('hr.employee.appraisal')
|
||||
|
||||
@api.depends('greed', 'great_level')
|
||||
# compute = '_compute_priority',
|
||||
# inverse = '_inverse_priority',
|
||||
# inverse='_inverse_priority',
|
||||
# @api.depends('greed', 'great_level','priority')
|
||||
@api.onchange('greed', 'great_level')
|
||||
def _compute_priority(self):
|
||||
for rec in self:
|
||||
if rec.great_level:
|
||||
value = rec.greed / (rec.great_level / 5)
|
||||
# 3.5
|
||||
if 1 <= value <= 2:
|
||||
if 1 <= value < 2:
|
||||
rec.priority = '1'
|
||||
elif 2 < value <= 3:
|
||||
elif 2 <= value < 3:
|
||||
rec.priority = '2'
|
||||
# 3.5
|
||||
elif 3 < value <= 4:
|
||||
elif 3 <= value < 4:
|
||||
rec.priority = '3'
|
||||
# 4
|
||||
elif 4 < value <= 5:
|
||||
elif 4 <= value < 5:
|
||||
rec.priority = '4'
|
||||
elif value > 5:
|
||||
elif value >= 5:
|
||||
rec.priority = '5'
|
||||
else:
|
||||
rec.priority = '0' # fallback
|
||||
else:
|
||||
rec.priority = '0'
|
||||
print("lllll")
|
||||
print(rec.priority)
|
||||
|
||||
@api.onchange('priority')
|
||||
def _inverse_priority(self):
|
||||
for rec in self:
|
||||
if rec.great_level and rec.priority:
|
||||
# 3*2
|
||||
# 2*4
|
||||
print("kkkkkkkkk")
|
||||
print(int(rec.priority) * (rec.great_level / 5))
|
||||
rec.greed = int(rec.priority) * (rec.great_level / 5)
|
||||
print(rec.greed)
|
||||
|
||||
@api.constrains('greed', 'great_level')
|
||||
def greed_constrains(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue