this way we avoid going until approve step to get an validation error
@ -58,9 +58,11 @@ class operation_request(models.Model):
def refuse_operation(self):
self.write({'state':'refused'})
@api.one
@api.multi
def submit_operation(self):
self.write({'state':'waiting'})
for rec in self:
rec.validate()
rec.write({'state':'waiting'})
def cancel_operation(self):