From ce1c3f90ab6c34bf68574d980f7d8d8726382fbc Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Thu, 23 Mar 2023 15:29:51 +0000 Subject: [PATCH] [FIX] l10n_fr_pos_cert: raise error when there is no order Before this commit: if the user wanted to generate a POS Inalterability Check statement, an IndexError was raised. This commit raises a more understandable error. opw-3237383 closes odoo/odoo#117398 X-original-commit: 9cc56fc3d3cdb43e393df0975e10192c3b10f455 Signed-off-by: Trinh Jacky (trj) Signed-off-by: Pedram Bi Ria (pebr) --- addons/l10n_fr_pos_cert/models/res_company.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_fr_pos_cert/models/res_company.py b/addons/l10n_fr_pos_cert/models/res_company.py index be5d0054c52..65f7098d4f5 100644 --- a/addons/l10n_fr_pos_cert/models/res_company.py +++ b/addons/l10n_fr_pos_cert/models/res_company.py @@ -65,6 +65,7 @@ class ResCompany(models.Model): if not orders: msg_alert = (_('There isn\'t any order flagged for data inalterability yet for the company %s. This mechanism only runs for point of sale orders generated after the installation of the module France - Certification CGI 286 I-3 bis. - POS', self.env.company.name)) + raise UserError(msg_alert) previous_hash = u'' corrupted_orders = []