Skip to content

Commit 9e6e4b5

Browse files
committed
⬆️1️⃣3️⃣ pos_logout
1 parent ff837c7 commit 9e6e4b5

File tree

6 files changed

+22
-129
lines changed

6 files changed

+22
-129
lines changed

pos_logout/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ Usage instructions: `<doc/index.rst>`_
3838

3939
Changelog: `<doc/changelog.rst>`_
4040

41-
Tested on Odoo 12.0 53dcdd5a9e22429a9638f68674264436ce21e42b
41+
Tested on Odoo 13.0 2d46a08a989f4c7e005ee2ead7c342c72019e63f

pos_logout/__manifest__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
22
# Copyright 2017-2018 Ilmir Karamov <https://it-projects.info/team/ilmir-k>
33
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
4+
# Copyright 2020 Almas Giniatullin <https://it-projects.info/team/almas50>
45
# License MIT (https://opensource.org/licenses/MIT).
56
{
67
"name": """Lock POS Screen""",
@@ -25,7 +26,7 @@
2526
"pre_init_hook": None,
2627
"post_init_hook": None,
2728
"auto_install": False,
28-
"installable": False,
29+
"installable": True,
2930
"demo_title": "Lock POS Screen",
3031
"demo_addons": [],
3132
"demo_addons_hidden": [],

pos_logout/static/src/js/chrome.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
/* Copyright 2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
22
Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
33
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
4+
Copyright 2020 Almas Giniatullin <https://it-projects.info/team/almas50>
45
License MIT (https://opensource.org/licenses/MIT). */
5-
odoo.define("pos_logout.chrome", function(require) {
6+
odoo.define("pos_logout.chrome", function (require) {
67
"use strict";
7-
8+
var Login = require("pos_hr.screens").LoginScreenWidget;
89
var chrome = require("point_of_sale.chrome");
910

1011
chrome.UsernameWidget.include({
11-
click_username: function(block) {
12+
click_username: function (block) {
1213
this._super();
1314
var self = this;
14-
this.gui.current_popup.cashiers = true;
15-
this.gui.current_popup.renderElement();
16-
this.gui.current_popup.$(".exit").click(function() {
17-
self.gui.show_popup("block");
18-
});
19-
this.gui.current_popup.cashiers = false;
15+
if (self.pos.config.module_pos_hr) {
16+
this.gui.current_popup.cashiers = true;
17+
this.gui.current_popup.renderElement();
18+
this.gui.current_popup.$(".exit").click(function () {
19+
self.gui.show_screen("login");
20+
});
21+
this.gui.current_popup.cashiers = false;
22+
}
2023
},
2124
});
2225

2326
chrome.Chrome.include({
24-
loading_hide: function() {
27+
loading_hide: function () {
2528
this._super();
2629
var self = this;
27-
var set_logout_interval = function(time) {
30+
var set_logout_interval = function (time) {
2831
time = time || self.pos.config.logout_interval * 1000;
2932
if (time) {
30-
self.pos.logout_timer = setTimeout(function() {
31-
self.pos.gui.show_popup("block");
33+
self.pos.logout_timer = setTimeout(function () {
34+
self.pos.gui.show_screen("login");
3235
}, time);
3336
}
3437
};
3538
if (this.pos.config.logout_interval) {
36-
$(document).on("click", function(event) {
39+
$(document).on("click", function (event) {
3740
clearTimeout(self.pos.logout_timer);
3841
set_logout_interval();
3942
});

pos_logout/static/src/js/popups.js

Lines changed: 0 additions & 101 deletions
This file was deleted.

pos_logout/static/src/xml/pos.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,4 @@
99
</t>
1010
</t>
1111
</t>
12-
<t t-name="BlockPopupWidget">
13-
<div class="modal-dialog block">
14-
<div class="popup popup-selection">
15-
<span>
16-
<i class="fa fa-lock" />
17-
<p>Tap to unlock...</p>
18-
</span>
19-
</div>
20-
</div>
21-
</t>
2212
</templates>

pos_logout/views/pos_logout.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
44
Copyright 2017 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
55
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
6+
Copyright 2020 Almas Giniatullin <https://it-projects.info/team/almas50>
67
License MIT (https://opensource.org/licenses/MIT). -->
78
<odoo>
89
<template
@@ -13,7 +14,6 @@
1314
<xpath expr="." position="inside">
1415
<link rel="stylesheet" href="/pos_logout/static/src/css/pos_logout.css" />
1516
<script type="text/javascript" src="/pos_logout/static/src/js/chrome.js" />
16-
<script type="text/javascript" src="/pos_logout/static/src/js/popups.js" />
1717
</xpath>
1818
</template>
1919
<template
@@ -30,7 +30,7 @@
3030
<field name="model">pos.config</field>
3131
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
3232
<field name="arch" type="xml">
33-
<xpath expr="//field[@name='iface_big_scrollbars']/../.." position="after">
33+
<xpath expr="//field[@name='module_pos_restaurant']/../.." position="after">
3434
<div class="col-xs-12 col-md-6 o_setting_box">
3535
<div class="o_setting_right_pane">
3636
<label for="logout_interval" />

0 commit comments

Comments
 (0)