Browse Source

[IMP] add call to validate in submit_operation function

this way we avoid going until approve step to get an validation error
pull/1/head
houssine 6 years ago
parent
commit
a2e94d0a85
  1. 6
      easy_my_coop/models/operation_request.py

6
easy_my_coop/models/operation_request.py

@ -58,9 +58,11 @@ class operation_request(models.Model):
def refuse_operation(self): def refuse_operation(self):
self.write({'state':'refused'}) self.write({'state':'refused'})
@api.one
@api.multi
def submit_operation(self): def submit_operation(self):
self.write({'state':'waiting'})
for rec in self:
rec.validate()
rec.write({'state':'waiting'})
@api.one @api.one
def cancel_operation(self): def cancel_operation(self):

Loading…
Cancel
Save