Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
8e674c4c
Commit
8e674c4c
authored
Jun 24, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_cooperatic' into 3337-message-restaurant-check
parents
ce66b446
09597260
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
3 deletions
+55
-3
pos_payment_terminal.js
...os_payment_terminal/static/src/js/pos_payment_terminal.js
+1
-1
__openerp__.py
lacagette_addons/lacagette_custom_pos/__openerp__.py
+2
-1
fr.po
lacagette_addons/lacagette_custom_pos/i18n/fr.po
+5
-0
pos_config.py
lacagette_addons/lacagette_custom_pos/models/pos_config.py
+5
-0
screens.js
...ette_addons/lacagette_custom_pos/static/src/js/screens.js
+41
-1
view_pos_config.xml
...tte_addons/lacagette_custom_pos/views/view_pos_config.xml
+1
-0
No files found.
extra_addons/pos_payment_terminal/static/src/js/pos_payment_terminal.js
View file @
8e674c4c
...
...
@@ -107,7 +107,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) {
this
.
_super
.
apply
(
this
,
arguments
);
var
line
=
this
.
pos
.
get_order
().
selected_paymentline
;
var
auto
=
line
.
get_automatic_payment_terminal
();
$
(
'.back'
).
hide
();
//
$('.back').hide();
if
(
auto
)
{
this
.
pos
.
proxy
.
payment_terminal_transaction_start
(
self
,
self
.
pos
.
currency
.
name
);
}
...
...
lacagette_addons/lacagette_custom_pos/__openerp__.py
View file @
8e674c4c
...
...
@@ -14,7 +14,8 @@
Personnalisation de la popup d'erreur "codebarre non reconnu" :
\n
- Faire clignoter la popup d'erreur quand le codebarre n'est pas reconnu
- Jouer le son d'erreur plusieurs fois
- [FONCTION COMMENTEE] Afficher dans la popup le dernier produit scanné
- [FONCTION DÉSACTIVÉE] Afficher dans la popup le dernier produit scanné
\n
Bloquer ou non la fermeture d'une session de caisse s'il reste une commande en cours (configurable pour chaque caisse)
"""
,
'author'
:
"fracolo"
,
...
...
lacagette_addons/lacagette_custom_pos/i18n/fr.po
View file @
8e674c4c
...
...
@@ -21,6 +21,11 @@ msgid "Reload on prices change"
msgstr "Rechargement si des prix changent"
#. module: lacagette_custom_pos
#: model:ir.model.fields,field_description:lacagette_custom_pos.field_pos_config__can_close_pos_with_ongoing_order
msgid "Allow closing a pos session in case of ongoing order"
msgstr "Autoriser la fermeture d'une session de caisse s'il reste une commande en cours"
#. module: lacagette_custom_pos
#. openerp-web
#: code:lacagette_addons/lacagette_custom_pos/static/src/js/screens.js:73
#, python-format
...
...
lacagette_addons/lacagette_custom_pos/models/pos_config.py
View file @
8e674c4c
...
...
@@ -7,3 +7,7 @@ class PosConfig(models.Model):
reload_on_prices_change
=
fields
.
Boolean
(
string
=
"Reload on prices change"
,
default
=
False
)
can_close_pos_with_ongoing_order
=
fields
.
Boolean
(
string
=
"Allow closing a pos session in case of ongoing order"
,
default
=
True
)
\ No newline at end of file
lacagette_addons/lacagette_custom_pos/static/src/js/screens.js
View file @
8e674c4c
...
...
@@ -9,7 +9,8 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
var
_t
=
core
.
_t
;
const
interval
=
60
*
60
*
1000
;
// used for last_price_change call
var
reload_on_prices_change
=
false
;
models
.
load_fields
(
"pos.config"
,
[
'reload_on_prices_change'
]);
models
.
load_fields
(
"pos.config"
,
[
'reload_on_prices_change'
,
'can_cclose_pos_with_ongoing_order'
]);
var
close_button_action_setup
=
false
;
const
update_last_price_change_data
=
async
function
()
{
/*
...
...
@@ -130,4 +131,43 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
}
});
screens
.
ScreenWidget
.
include
({
init
:
function
(
parent
,
options
){
this
.
_super
(
parent
,
options
);
/*
* If activated in this pos session, prevent closing the session if there is an ongoing order.
* This is a hacky DOM manipulation: the user can technically close the session if he closes the popup and press 'Close' again in less than 2s.
* But this is very unlikely.
*
* ScreenWidget is a base widget extended by many others, we do this here to be sure this code is called...
*/
if
(
close_button_action_setup
===
false
)
{
// ... but we need to make sure it is called only once
close_button_action_setup
=
true
;
if
(
this
.
pos
.
config
.
can_close_pos_with_ongoing_order
===
false
)
{
let
header_nodes
=
document
.
querySelectorAll
(
".pos-topheader .pos-rightheader div"
);
let
close_button_div
=
header_nodes
[
header_nodes
.
length
-
1
];
let
self
=
this
;
close_button_div
.
addEventListener
(
"click"
,
function
(
e
)
{
let
order
=
self
.
pos
.
get_order
();
if
(
!
order
.
is_empty
())
{
if
(
close_button_div
.
classList
.
contains
(
"confirm"
))
{
close_button_div
.
classList
.
remove
(
"confirm"
);
close_button_div
.
textContent
=
_t
(
'Close'
);
}
self
.
gui
.
show_popup
(
"alert"
,
{
'title'
:
_t
(
"Impossible de fermer la caisse"
),
'body'
:
_t
(
"Des commandes sont encore en cours."
)
});
}
});
}
}
},
});
});
lacagette_addons/lacagette_custom_pos/views/view_pos_config.xml
View file @
8e674c4c
...
...
@@ -9,6 +9,7 @@
<field
name=
"arch"
type=
"xml"
>
<field
name=
"cash_control"
position=
"after"
>
<field
name=
"reload_on_prices_change"
/>
<field
name=
"can_close_pos_with_ongoing_order"
/>
</field>
</field>
</record>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment