From 88a6d49f7c6343d0e9fa050e37a3b7d9517aff53 Mon Sep 17 00:00:00 2001 From: Invitu Date: Fri, 28 Jul 2017 18:47:06 -1000 Subject: [PATCH] [MIG] pos_quick_logout: Migration to 10.0 [FIX] Fix Travis [FIX] Fix Licence [FIX] rename pos_quick_logout.py to pos_config.py [FIX] Travis [FIX] fix javascript syntax + __manifest__ typo [FIX] fix python syntax [FIX] rename pos_quick_logout_view.xml to pos_config_view.xml [FIX] Travis : remove unused imports --- pos_quick_logout/README.rst | 3 +-- pos_quick_logout/__init__.py | 2 +- .../{__openerp__.py => __manifest__.py} | 5 +++-- pos_quick_logout/models/__init__.py | 2 +- .../models/{pos_quick_logout.py => pos_config.py} | 2 +- pos_quick_logout/static/src/js/pos_quick_logout.js | 14 +++++++------- ...s_quick_logout_view.xml => pos_config_view.xml} | 0 7 files changed, 14 insertions(+), 14 deletions(-) rename pos_quick_logout/{__openerp__.py => __manifest__.py} (88%) rename pos_quick_logout/models/{pos_quick_logout.py => pos_config.py} (83%) rename pos_quick_logout/views/{pos_quick_logout_view.xml => pos_config_view.xml} (100%) diff --git a/pos_quick_logout/README.rst b/pos_quick_logout/README.rst index 9432e1bf..3e23dc98 100644 --- a/pos_quick_logout/README.rst +++ b/pos_quick_logout/README.rst @@ -24,8 +24,7 @@ Implemented Features .. image:: /pos_quick_logout/static/description/cashier_user_identical.png -* If the cashier changed, and is not the user logged in Odoo, the extra button -appears +* If the cashier changed, and is not the user logged in Odoo, the extra button appears .. image:: /pos_quick_logout/static/description/cashier_user_different.png diff --git a/pos_quick_logout/__init__.py b/pos_quick_logout/__init__.py index 89d26e2f..a0fdc10f 100644 --- a/pos_quick_logout/__init__.py +++ b/pos_quick_logout/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -import models +from . import models diff --git a/pos_quick_logout/__openerp__.py b/pos_quick_logout/__manifest__.py similarity index 88% rename from pos_quick_logout/__openerp__.py rename to pos_quick_logout/__manifest__.py index a6bfea4e..0dbfb794 100644 --- a/pos_quick_logout/__openerp__.py +++ b/pos_quick_logout/__manifest__.py @@ -6,16 +6,17 @@ { 'name': 'Point of Sale - Quick Logout', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Point Of Sale', 'summary': 'Allow PoS user to logout quickly after user changed', + 'license': 'AGPL-3', 'author': 'La Louve, Odoo Community Association (OCA)', 'website': 'http://www.lalouve.net', 'depends': [ 'point_of_sale', ], 'data': [ - 'views/pos_quick_logout_view.xml', + 'views/pos_config_view.xml', 'static/src/xml/templates.xml', ], 'qweb': [ diff --git a/pos_quick_logout/models/__init__.py b/pos_quick_logout/models/__init__.py index 48639810..e77b6015 100644 --- a/pos_quick_logout/models/__init__.py +++ b/pos_quick_logout/models/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -import pos_quick_logout +from . import pos_config diff --git a/pos_quick_logout/models/pos_quick_logout.py b/pos_quick_logout/models/pos_config.py similarity index 83% rename from pos_quick_logout/models/pos_quick_logout.py rename to pos_quick_logout/models/pos_config.py index 5466bef0..55106238 100644 --- a/pos_quick_logout/models/pos_quick_logout.py +++ b/pos_quick_logout/models/pos_config.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from odoo import models, api, fields, exceptions +from odoo import models, fields class PosConfig(models.Model): diff --git a/pos_quick_logout/static/src/js/pos_quick_logout.js b/pos_quick_logout/static/src/js/pos_quick_logout.js index c26aa2fb..a96cd2a0 100644 --- a/pos_quick_logout/static/src/js/pos_quick_logout.js +++ b/pos_quick_logout/static/src/js/pos_quick_logout.js @@ -31,14 +31,14 @@ chrome.Chrome if (self.widget.username) { self.pos.set_cashier(self.pos.user); self.widget.username.renderElement(); - }; + } }, resetTimer: function() { var self = this; clearTimeout(this.timer); this.timer = setTimeout(function(){ self.logout(); - }, self.pos.config.logout_timeout * 1000); // time is in milliseconds + }, self.pos.config.logout_timeout * 1000); }, renderElement: function(){ this._super(); @@ -47,7 +47,7 @@ chrome.Chrome self.pos.set_cashier(self.pos.user); self.widget.username.renderElement(); }); - }, + } }); /* ******************************************************** @@ -56,12 +56,12 @@ chrome.Chrome chrome.UsernameWidget.include({ renderElement: function(){ this._super(); - if (this.pos.user.id != this.pos.get_cashier().id){ - $('#pos-quick-logout').show(); - }else{ + if (this.pos.user.id === this.pos.get_cashier().id){ $('#pos-quick-logout').hide(); + }else{ + $('#pos-quick-logout').show(); } - }, + } }); }); diff --git a/pos_quick_logout/views/pos_quick_logout_view.xml b/pos_quick_logout/views/pos_config_view.xml similarity index 100% rename from pos_quick_logout/views/pos_quick_logout_view.xml rename to pos_quick_logout/views/pos_config_view.xml