Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
d3c18f58
Commit
d3c18f58
authored
10 years ago
by
Frédéric van der Essen
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] point_of_sale: automatically close the point of sale when open in another tab.
parent
5979662e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/point_of_sale/static/src/js/gui.js
+31
-0
31 additions, 0 deletions
addons/point_of_sale/static/src/js/gui.js
with
31 additions
and
0 deletions
addons/point_of_sale/static/src/js/gui.js
+
31
−
0
View file @
d3c18f58
...
...
@@ -26,6 +26,7 @@ var Gui = core.Class.extend({
this
.
current_screen
=
null
;
this
.
chrome
.
ready
.
then
(
function
(){
self
.
close_other_tabs
();
var
order
=
self
.
pos
.
get_order
();
if
(
order
)
{
self
.
show_saved_screen
(
order
);
...
...
@@ -174,6 +175,36 @@ var Gui = core.Class.extend({
return
!!
this
.
current_popup
;
},
/* ---- Gui: INTER TAB COMM ---- */
// This sets up automatic pos exit when open in
// another tab.
close_other_tabs
:
function
()
{
var
self
=
this
;
localStorage
[
'
message
'
]
=
''
;
localStorage
[
'
message
'
]
=
JSON
.
stringify
({
'
message
'
:
'
close_tabs
'
,
'
session
'
:
this
.
pos
.
pos_session
.
id
,
});
window
.
addEventListener
(
"
storage
"
,
function
(
event
)
{
var
msg
=
event
.
data
;
if
(
event
.
key
===
'
message
'
&&
event
.
newValue
)
{
var
msg
=
JSON
.
parse
(
event
.
newValue
);
if
(
msg
.
message
===
'
close_tabs
'
&&
msg
.
session
==
self
.
pos
.
pos_session
.
id
)
{
console
.
info
(
'
POS / Session opened in another window. EXITING POS
'
)
self
.
_close
();
}
}
},
false
);
},
/* ---- Gui: ACCESS CONTROL ---- */
// A Generic UI that allow to select a user from a list.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment