Skip to content

Commit

Permalink
[IMP] point_of_sale: Navigation as employee from frontend to backend.
Browse files Browse the repository at this point in the history
We added a button for the front end closure to go back to the back end.
Before this, the only way to go back was to change the URL, now we can close the session with the frontend properly.

Also moved the css related to pos_hr in the good directory.
Task-id: 2032178

closes #34948

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
  • Loading branch information
rhe-odoo authored and pimodoo committed Aug 2, 2019
1 parent 2ef96ee commit 987951a
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 79 deletions.
79 changes: 0 additions & 79 deletions addons/point_of_sale/static/src/css/pos.css
Expand Up @@ -2445,82 +2445,3 @@ td {
.pos .not-supported-browser img{
border-collapse: separate;
}

/* ********* Login Screen ********* */

.pos .login-overlay{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height:100%;
z-index:1000;
background: linear-gradient(to right bottom, #77717e, #c9a8a9);
}
.pos .login-overlay:before {
content: '';
background-image: url(../../img/login-bg-overlay.svg);
background-color: rgba(0, 0, 0, 0.3);
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height:100%;
}
.pos .screen-login{
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
margin: auto;
width:550px;
height:300px;
text-align:center;
font-size:20px;
font-weight:bold;
background-color: #F0EEEE;
border-radius: 3px;
z-index:1200;
font-family: 'Lato';
}
.pos .login-title{
height: 55%;
vertical-align: middle;
line-height: 5;
font-size: larger;
}
.pos .login-body{
height:33%;
}
.pos .login-element{
float: left;
width: 45%;
height: 60%;
}
.pos .login-barcode-img{
width: 80px;
height: 55px;
background: white;
border: 0px;
}
.pos .login-barcode-text{
color: #999999;
font-size: 13px;
padding-top: 0.2em;
}
.pos .login-or{
font-size: 15px;
font-style: italic;
float: left;
width: 10%;
height: 100%;
line-height: 5;
}
.pos .login-button{
font-size: initial;
height: 100%;
color: #555555;
border-radius: 5px;
}
81 changes: 81 additions & 0 deletions addons/pos_hr/static/src/css/pos.css
@@ -0,0 +1,81 @@
.pos .login-overlay{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height:100%;
z-index:1000;
background: linear-gradient(to right bottom, #77717e, #c9a8a9);
}
.pos .login-overlay:before {
content: '';
background-image: url(../../img/login-bg-overlay.svg);
background-color: rgba(0, 0, 0, 0.3);
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height:100%;
}
.pos .screen-login{
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
margin: auto;
width:550px;
height:300px;
text-align:center;
font-size:20px;
font-weight:bold;
background-color: #F0EEEE;
border-radius: 3px;
z-index:1200;
font-family: 'Lato';
}
.pos .login-title{
height: 40%;
vertical-align: middle;
line-height: 5;
font-size: larger;
}
.pos .login-body{
height:37%;
}

.pos .login-footer{
height:18%;
}

.pos .login-element{
float: left;
width: 40%;
height: 60%;
}
.pos .login-barcode-img{
width: 80px;
height: 55px;
background: white;
border: 0px;
}
.pos .login-barcode-text{
color: #999999;
font-size: 13px;
padding-top: 0.2em;
}
.pos .login-or{
font-size: 15px;
font-style: italic;
float: left;
width: 10%;
height: 100%;
line-height: 5;
}
.pos .login-button{
font-size: initial;
height: 100%;
color: #555555;
border-radius: 5px;
}
5 changes: 5 additions & 0 deletions addons/pos_hr/static/src/js/screens.js
Expand Up @@ -73,6 +73,11 @@ var LoginScreenWidget = ScreenWidget.extend({
self.unlock_screen();
});
});

this.$('.close-session').click(function() {
self.gui.close();
});

this._super();
},

Expand Down
5 changes: 5 additions & 0 deletions addons/pos_hr/static/src/xml/pos.xml
Expand Up @@ -14,6 +14,11 @@
<button class="login-button select-employee">Select Cashier</button>
</span>
</div>
<div class="login-footer">
<small>
<button class="login-button close-session">Close session</button>
</small>
</div>
</div>
</div>
</t>
Expand Down
2 changes: 2 additions & 0 deletions addons/pos_hr/views/point_of_sale.xml
Expand Up @@ -2,6 +2,8 @@
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/pos_hr/static/src/css/pos.css"/>

<script type="text/javascript" src="/pos_hr/static/src/js/models.js"></script>
<script type="text/javascript" src="/pos_hr/static/src/js/screens.js"></script>
<script type="text/javascript" src="/pos_hr/static/src/js/gui.js"></script>
Expand Down

0 comments on commit 987951a

Please sign in to comment.