I have these buttons:
def update(self):
evaluation_cycle_model = self.env[
'sst.initial.evaluation.by.cycles'].search([('id', '=',self.evaluation_id.id)],limit=1)
if evaluation_cycle_model:
evaluation_cycle_model.update_records()
view_id = self.env.ref('sst.view_sst_qualification_form').id
return {
'type': 'ir.actions.act_window',
'name': 'Calificar Items',
'res_model': 'sst.initial.evaluation.by.cycles',
'res_id': self.id,
'view_mode': 'form',
'views': [[view_id, 'form']],
'target': 'new',
'tag': 'reload'
}
def action_discard(self):
view_id = self.env.ref('sst.view_sst_qualification_form').id
return {
'type': 'ir.actions.act_window',
'name': 'Calificar Items',
'res_model': 'sst.initial.evaluation.by.cycles',
'res_id': self.id,
'view_mode': 'form',
'views': [[view_id, 'form']],
'target': 'new',
}
I have this action_discard button, which returns an action to return to a specific view, my question is, how can I make the button works? The action it returns works, but it does not discard the information, on the contrary it saves it in the database.