Browse Source

[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
pull/239/head
Invitu 7 years ago
committed by Sylvain LE GAL
parent
commit
88a6d49f7c
  1. 3
      pos_quick_logout/README.rst
  2. 2
      pos_quick_logout/__init__.py
  3. 5
      pos_quick_logout/__manifest__.py
  4. 2
      pos_quick_logout/models/__init__.py
  5. 2
      pos_quick_logout/models/pos_config.py
  6. 14
      pos_quick_logout/static/src/js/pos_quick_logout.js
  7. 0
      pos_quick_logout/views/pos_config_view.xml

3
pos_quick_logout/README.rst

@ -24,8 +24,7 @@ Implemented Features
.. image:: /pos_quick_logout/static/description/cashier_user_identical.png .. 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 .. image:: /pos_quick_logout/static/description/cashier_user_different.png

2
pos_quick_logout/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models
from . import models

5
pos_quick_logout/__openerp__.py → pos_quick_logout/__manifest__.py

@ -6,16 +6,17 @@
{ {
'name': 'Point of Sale - Quick Logout', 'name': 'Point of Sale - Quick Logout',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Point Of Sale', 'category': 'Point Of Sale',
'summary': 'Allow PoS user to logout quickly after user changed', 'summary': 'Allow PoS user to logout quickly after user changed',
'license': 'AGPL-3',
'author': 'La Louve, Odoo Community Association (OCA)', 'author': 'La Louve, Odoo Community Association (OCA)',
'website': 'http://www.lalouve.net', 'website': 'http://www.lalouve.net',
'depends': [ 'depends': [
'point_of_sale', 'point_of_sale',
], ],
'data': [ 'data': [
'views/pos_quick_logout_view.xml',
'views/pos_config_view.xml',
'static/src/xml/templates.xml', 'static/src/xml/templates.xml',
], ],
'qweb': [ 'qweb': [

2
pos_quick_logout/models/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import pos_quick_logout
from . import pos_config

2
pos_quick_logout/models/pos_quick_logout.py → pos_quick_logout/models/pos_config.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from odoo import models, api, fields, exceptions
from odoo import models, fields
class PosConfig(models.Model): class PosConfig(models.Model):

14
pos_quick_logout/static/src/js/pos_quick_logout.js

@ -31,14 +31,14 @@ chrome.Chrome
if (self.widget.username) { if (self.widget.username) {
self.pos.set_cashier(self.pos.user); self.pos.set_cashier(self.pos.user);
self.widget.username.renderElement(); self.widget.username.renderElement();
};
}
}, },
resetTimer: function() { resetTimer: function() {
var self = this; var self = this;
clearTimeout(this.timer); clearTimeout(this.timer);
this.timer = setTimeout(function(){ this.timer = setTimeout(function(){
self.logout(); self.logout();
}, self.pos.config.logout_timeout * 1000); // time is in milliseconds
}, self.pos.config.logout_timeout * 1000);
}, },
renderElement: function(){ renderElement: function(){
this._super(); this._super();
@ -47,7 +47,7 @@ chrome.Chrome
self.pos.set_cashier(self.pos.user); self.pos.set_cashier(self.pos.user);
self.widget.username.renderElement(); self.widget.username.renderElement();
}); });
},
}
}); });
/* ******************************************************** /* ********************************************************
@ -56,12 +56,12 @@ chrome.Chrome
chrome.UsernameWidget.include({ chrome.UsernameWidget.include({
renderElement: function(){ renderElement: function(){
this._super(); 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(); $('#pos-quick-logout').hide();
}else{
$('#pos-quick-logout').show();
}
} }
},
}); });
}); });

0
pos_quick_logout/views/pos_quick_logout_view.xml → pos_quick_logout/views/pos_config_view.xml

Loading…
Cancel
Save