From a2e94d0a858ec9d67d4a4cc411092788b39ac422 Mon Sep 17 00:00:00 2001 From: houssine Date: Sat, 1 Dec 2018 18:22:51 +0100 Subject: [PATCH] [IMP] add call to validate in submit_operation function this way we avoid going until approve step to get an validation error --- easy_my_coop/models/operation_request.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/easy_my_coop/models/operation_request.py b/easy_my_coop/models/operation_request.py index f2aef51..ac75d22 100644 --- a/easy_my_coop/models/operation_request.py +++ b/easy_my_coop/models/operation_request.py @@ -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'}) @api.one def cancel_operation(self):