diff --git a/pos_config_single_user/__init__.py b/pos_config_single_user/__init__.py index cc89676..4349578 100644 --- a/pos_config_single_user/__init__.py +++ b/pos_config_single_user/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import pos diff --git a/pos_config_single_user/__manifest__.py b/pos_config_single_user/__manifest__.py index 7712ddb..4e276e9 100644 --- a/pos_config_single_user/__manifest__.py +++ b/pos_config_single_user/__manifest__.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Akretion (Alexis de Lattre ) +# Copyright 2014-2020 Akretion France (http://www.akretion.com/) +# @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'POS Config Single User', - 'version': '10.0.1.0.0', + 'version': '14.0.1.0.0', 'category': 'Point Of Sale', 'license': 'AGPL-3', 'summary': 'Configure on each pos.config a single user allowed to start it', diff --git a/pos_config_single_user/pos.py b/pos_config_single_user/pos.py index 173e618..deedd0f 100644 --- a/pos_config_single_user/pos.py +++ b/pos_config_single_user/pos.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Akretion (Alexis de Lattre ) +# Copyright 2014-2020 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import fields, models, _ +from odoo.exceptions import UserError class PosConfig(models.Model): @@ -14,14 +14,13 @@ class PosConfig(models.Model): help="If you select a user, only this user will be allowed to start " "sessions for this POS", ondelete='restrict') - @api.multi - def open_session_cb(self): + def open_session_cb(self, check_coa=True): self.ensure_one() if ( self.allowed_user_id and self.allowed_user_id != self.env.user): raise UserError(_( "The POS '%s' can be used only by user '%s'.") % ( - self.name, - self.allowed_user_id.name)) - return super(PosConfig, self).open_session_cb() + self.display_name, + self.allowed_user_id.display_name)) + return super().open_session_cb(check_coa=check_coa) diff --git a/pos_config_single_user/pos_view.xml b/pos_config_single_user/pos_view.xml index 3cd2c43..7628c61 100644 --- a/pos_config_single_user/pos_view.xml +++ b/pos_config_single_user/pos_view.xml @@ -1,20 +1,31 @@ - + pos_config_single_user.pos.config pos.config - + - - - + +
+
+
+
+