appraial
This commit is contained in:
parent
890110fda9
commit
2cd9f4bd3b
|
|
@ -269,14 +269,51 @@ class StandardAppraisalLines(models.Model):
|
|||
('2', '3'),
|
||||
('3', '4'),
|
||||
('4', '5'),
|
||||
('5', '5'),
|
||||
],
|
||||
string='Priority',
|
||||
default='0',
|
||||
|
||||
index=True
|
||||
)
|
||||
|
||||
# Relational fields
|
||||
standard_appraisal_employee_line = fields.Many2one('hr.employee.appraisal') # inverse field
|
||||
# course_name.name
|
||||
standard_appraisal_employee_line = fields.Many2one('hr.employee.appraisal')
|
||||
|
||||
|
||||
|
||||
|
||||
# inverse field
|
||||
|
||||
@api.onchange('priority','greed')
|
||||
def change_priority(self):
|
||||
for rec in self:
|
||||
if rec.priority:
|
||||
if rec.priority == '1':
|
||||
rec.greed = 2
|
||||
elif rec.priority == '2':
|
||||
rec.greed = 4
|
||||
elif rec.priority == '3':
|
||||
rec.greed = 6
|
||||
elif rec.priority == '4':
|
||||
rec.greed = 8
|
||||
elif rec.priority == '5':
|
||||
rec.greed = 10
|
||||
|
||||
@api.onchange('priority', 'greed')
|
||||
def change_greed(self):
|
||||
for rec in self:
|
||||
if rec.greed:
|
||||
if rec.greed == 2:
|
||||
rec.priority = '1'
|
||||
elif rec.greed == 4:
|
||||
rec.priority = '2'
|
||||
elif rec.greed == 6:
|
||||
rec.priority = '3'
|
||||
elif rec.greed == 8:
|
||||
rec.priority = '4'
|
||||
elif rec.greed == 10:
|
||||
rec.priority = '5'
|
||||
|
||||
@api.constrains('greed', 'great_level')
|
||||
def greed_constrains(self):
|
||||
|
|
|
|||
|
|
@ -49,12 +49,14 @@
|
|||
attrs="{'invisible':[('is_manager','=',True)],'readonly':[('state', 'not in', ['draft', 'employee_confirmation'])] }">
|
||||
<tree editable="bottom">
|
||||
<field name="question" string="Question" readonly="1" force_save="1"/>
|
||||
<field name="priority" string="priority" widget="priority"/>
|
||||
|
||||
<field name="greed" string="Greed" required="1" force_save="1" store="1" />
|
||||
|
||||
<field name="accrued_greed" attrs="{
|
||||
'invisible': [('parent.employee_protest', '!=', True)],
|
||||
'column_invisible': [('parent.employee_protest', '!=', True)]
|
||||
}"/>
|
||||
<field name="priority" string="priority" widget="priority"/>
|
||||
<field name="great_level" string="Great Level" readonly="1" force_save="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class EmployeeAppraisal(models.Model):
|
|||
_inherit= 'hr.employee.appraisal'
|
||||
|
||||
mission_id = fields.Many2one('hr.official.mission', string="Training Course",domain=[("mission_type.work_state", "=", "training")])
|
||||
course_name = fields.Char(related='mission_id.course_name.name')
|
||||
|
||||
@api.onchange('department_id', 'mission_id', 'appraisal_type')
|
||||
def employee_ids_domain(self):
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
<xpath expr="//field[@name='appraisal_type']" position="after">
|
||||
<field name="mission_id" attrs="{'invisible':[('appraisal_type','!=', 'training')]}"/>
|
||||
<field name="course_name" attrs="{'invisible':[('appraisal_type','!=', 'training')]}"/>
|
||||
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
|
|
|
|||
Loading…
Reference in New Issue