appraial priority mclassif

This commit is contained in:
blackbelts 2025-06-23 16:00:04 +03:00
parent 8e206de046
commit d8e1e08589
1 changed files with 6 additions and 1 deletions

View File

@ -263,7 +263,7 @@ class StandardAppraisalLines(models.Model):
question = fields.Char()
great_level = fields.Float()
priority = fields.Selection(
[
[('0', '0'),
('1', '1'),
('2', '2'),
('3', '3'),
@ -301,12 +301,17 @@ class StandardAppraisalLines(models.Model):
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)
@api.constrains('greed', 'great_level')