From 0324a0679380cdb4b1c84dbd8c078c9a8f15d73a Mon Sep 17 00:00:00 2001 From: houssine Date: Fri, 15 Jun 2018 14:08:26 +0200 Subject: [PATCH] [IMP] cannot validate a subscription request with share number smaller or equal 0 --- easy_my_coop/models/coop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/models/coop.py b/easy_my_coop/models/coop.py index 22df8c4..4780a4f 100644 --- a/easy_my_coop/models/coop.py +++ b/easy_my_coop/models/coop.py @@ -288,7 +288,9 @@ class subscription_request(models.Model): @api.one def validate_subscription_request(self): partner_obj = self.env['res.partner'] - + + if self.ordered_parts <= 0: + raise UserError(_('Number of share must be greater than 0.')) if self.partner_id: if not self.partner_id.cooperator: self.partner_id.cooperator = True