From 2b9d11bb5cb9adda2ed9ec51efd298b00ff57039 Mon Sep 17 00:00:00 2001 From: houssine Date: Fri, 16 Feb 2018 14:39:21 +0100 Subject: [PATCH] [FIX] fix one case here the evaluation shouldn't be True --- easy_my_coop/models/coop.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/easy_my_coop/models/coop.py b/easy_my_coop/models/coop.py index 03b5afd..f87ecdf 100644 --- a/easy_my_coop/models/coop.py +++ b/easy_my_coop/models/coop.py @@ -86,22 +86,25 @@ class subscription_request(models.Model): @api.depends('iban', 'no_registre','skip_control_ng') def _validated_lines(self): for sub_request in self: + validated = False try: base_iban.validate_iban(sub_request.iban) - sub_request.validated = True + validated = True except ValidationError: - sub_request.validated = False + validated = False if not sub_request.is_company and (sub_request.skip_control_ng or self.check_belgian_identification_id(sub_request.no_registre)): - sub_request.validated = True - + validated = True + else: + validated = False + sub_request.validated = validated @api.multi @api.depends('share_product_id', 'share_product_id.list_price','ordered_parts') def _compute_subscription_amount(self): for sub_request in self: sub_request.subscription_amount = sub_request.share_product_id.list_price * sub_request.ordered_parts - already_cooperator = fields.Boolean(string="I'm already cooperator") + already_cooperator = fields.Boolean(string="I'm already cooperator") name = fields.Char(string='Name', required=True) firstname = fields.Char(string='Firstname') lastname = fields.Char(string='Lastname')