diff --git a/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot b/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot index 71428cdaf83..aa4c2e87e60 100644 --- a/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot +++ b/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot @@ -68,6 +68,15 @@ msgstr "" msgid "Account Closing" msgstr "" +#. module: l10n_fr_pos_cert +#. odoo-python +#: code:addons/l10n_fr_pos_cert/models/res_company.py:0 +#, python-format +msgid "" +"Accounting is not unalterable for the company %s. This mechanism is designed" +" for companies where accounting is unalterable." +msgstr "" + #. module: l10n_fr_pos_cert #. odoo-python #: code:addons/l10n_fr_pos_cert/models/pos.py:0 diff --git a/addons/l10n_fr_pos_cert/models/res_company.py b/addons/l10n_fr_pos_cert/models/res_company.py index 65f7098d4f5..a6cd8c793c6 100644 --- a/addons/l10n_fr_pos_cert/models/res_company.py +++ b/addons/l10n_fr_pos_cert/models/res_company.py @@ -95,3 +95,5 @@ class ResCompany(models.Model): 'printing_date': format_date(self.env, Date.to_string( Date.today())), 'corrupted_orders': corrupted_orders or 'None' } + else: + raise UserError(_('Accounting is not unalterable for the company %s. This mechanism is designed for companies where accounting is unalterable.') % self.env.company.name) diff --git a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py index d7c36038022..348cbac473a 100644 --- a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py +++ b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py @@ -10,10 +10,8 @@ class ReportPosHashIntegrity(models.AbstractModel): @api.model def _get_report_values(self, docids, data=None): - if data: - data.update(self.env.company._check_pos_hash_integrity()) - else: - data = self.env.company._check_hash_pos_integrity() + data = data or {} + data.update(self.env.company._check_pos_hash_integrity() or {}) return { 'doc_ids' : docids, 'doc_model' : self.env['res.company'],