[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) <trj@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user