class mk_stage(models.Model):
_name = 'mk.stage'
name = fields.Char(string='Stage')
max_number = fields.Integer(string='Max number of Stages')
class mk_link_student(models.Model):
_name = 'mk.link.student'_descriptio
_rec_name = 'name_stage_id'
name_stage_id = fields.Many2one( 'mk.stage',string='Name Stage', )
remain_num = fields.Integer( string='Remaining number',
student_ids = fields.Many2many('mk.student.register', string = 'Student')
i do onchange (name_stage_ids) in field remain_number save max_number from name_stage_ids
i want calculate remain_number depend on student_ids if increase remain_number =name_stage_id.max_number - student_ids.id if decrease name_stage_ids.max_number + student_ids.id