Skip to content
Snippets Groups Projects
Commit 8c325324 authored by Jérôme Vanhaudenard's avatar Jérôme Vanhaudenard
Browse files

[FIX] l10n_fr_pos_cert: Ensure country set on company before opening POS


Before this fix, if the country is not set on the company
the loading of the session may stall at some point.

A check is added and will prevent to start a session if the country
is not set.

opw-2557989

closes odoo/odoo#79212

Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
parent 37a999dc
No related branches found
No related tags found
No related merge requests found
...@@ -14,9 +14,12 @@ class pos_config(models.Model): ...@@ -14,9 +14,12 @@ class pos_config(models.Model):
_inherit = 'pos.config' _inherit = 'pos.config'
def open_ui(self): def open_ui(self):
for config in self.filtered(lambda c: c.company_id._is_accounting_unalterable()): for config in self:
if config.current_session_id: if not config.company_id.country_id:
config.current_session_id._check_session_timing() raise UserError(_("You have to set a country in your company setting."))
if config.company_id._is_accounting_unalterable():
if config.current_session_id:
config.current_session_id._check_session_timing()
return super(pos_config, self).open_ui() return super(pos_config, self).open_ui()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment