Skip to content

Commit

Permalink
🌈 pre-commit
Browse files Browse the repository at this point in the history
> Made via .github/workflows/DINAR-PORT.yml
  • Loading branch information
itpp-bot committed Feb 26, 2021
1 parent 0352b82 commit 36177a0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
10 changes: 5 additions & 5 deletions pos_logout/static/src/js/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2020 Almas Giniatullin <https://it-projects.info/team/almas50>
License MIT (https://opensource.org/licenses/MIT). */
odoo.define("pos_logout.chrome", function(require) {
odoo.define("pos_logout.chrome", function (require) {
"use strict";
var chrome = require("point_of_sale.chrome");

chrome.Chrome.include({
loading_hide: function() {
loading_hide: function () {
this._super();
var self = this;
var set_logout_interval = function(time) {
var set_logout_interval = function (time) {
time = time || self.pos.config.logout_interval * 1000;
if (time) {
self.pos.logout_timer = setTimeout(function() {
self.pos.logout_timer = setTimeout(function () {
self.pos.gui.show_screen("login");
}, time);
}
};
if (this.pos.config.logout_interval) {
$(document).on("click", function(event) {
$(document).on("click", function (event) {
clearTimeout(self.pos.logout_timer);
set_logout_interval();
});
Expand Down
13 changes: 4 additions & 9 deletions pos_logout/static/src/js/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2019 Kildebekov Anvar <https://it-projects.info/team/kildebekov>
* License MIT (https://opensource.org/licenses/MIT). */

odoo.define("pos_logout.tour", function(require) {
odoo.define("pos_logout.tour", function (require) {
"use strict";

var tour = require("web_tour.tour");
Expand Down Expand Up @@ -34,7 +34,7 @@ odoo.define("pos_logout.tour", function(require) {
trigger: ".pos:has(.loader:hidden)",
content: "waiting for loading to finish",
timeout: 20000,
run: function() {
run: function () {
// It's a check
},
},
Expand All @@ -46,8 +46,6 @@ odoo.define("pos_logout.tour", function(require) {
];
}



function pos_closing() {
return [
{
Expand All @@ -61,18 +59,15 @@ odoo.define("pos_logout.tour", function(require) {
{
content: "wait until backend is opened",
trigger: ".o_pos_kanban button.oe_kanban_action_button",
run: function() {
run: function () {
// No need to click on trigger
},
},
];
}

var steps = [];
steps = steps.concat(
pos_opening(),
pos_closing()
);
steps = steps.concat(pos_opening(), pos_closing());

tour.register("pos_logout_tour", {test: true, url: "/web"}, steps);
});
1 change: 1 addition & 0 deletions pos_logout/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import odoo.tests


@odoo.tests.common.at_install(True)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
Expand Down
3 changes: 2 additions & 1 deletion pos_logout/views/pos_logout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<div class="o_setting_right_pane">
<label for="logout_interval" />
<div class="text-muted">
The last activity interval to activate the automatic screen lock. Zero if auto-locking is not needed
The last activity interval to activate the automatic screen
lock. Zero if auto-locking is not needed
</div>
<div>
<field name="logout_interval" />
Expand Down
1 change: 1 addition & 0 deletions setup/pos_logout/odoo/addons/pos_logout
6 changes: 6 additions & 0 deletions setup/pos_logout/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 36177a0

Please sign in to comment.