Commit e13eb617 by Damien Moulard

[REC] ask password to add products

parent ef12490f
...@@ -55,6 +55,7 @@ EM_URL = '' ...@@ -55,6 +55,7 @@ EM_URL = ''
RECEPTION_MERGE_ORDERS_PSWD = 'jpsrcp' RECEPTION_MERGE_ORDERS_PSWD = 'jpsrcp'
RECEPTION_ADD_PRODUCTS_PSWD = 'jpsrcp'
RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, les produits non commandés, cassés ou pourris. \ RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, les produits non commandés, cassés ou pourris. \
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre." Merci d'indiquer un maximum d'informations, le nom du produit et son code barre."
DISPLAY_COL_AUTRES = False DISPLAY_COL_AUTRES = False
......
...@@ -352,6 +352,11 @@ ...@@ -352,6 +352,11 @@
Password to enter to validate merge orders processing Password to enter to validate merge orders processing
It has been set only to stop member action, considering the impact of the merge It has been set only to stop member action, considering the impact of the merge
- RECEPTION_ADD_PRODUCTS_PSWD = 'pass2makeApause'
Password to enter to add products to an order during reception
Same principle as previous pswd
- RECEPTION_PDT_LABELS_BTN_TEXT = 'Lancer l\'impression' - RECEPTION_PDT_LABELS_BTN_TEXT = 'Lancer l\'impression'
- RECEPTION_PDT_LABELS_FN = 'print_product_labels()' - RECEPTION_PDT_LABELS_FN = 'print_product_labels()'
......
...@@ -1750,7 +1750,9 @@ var get_barcodes = async function() { ...@@ -1750,7 +1750,9 @@ var get_barcodes = async function() {
if (barcodes == null) barcodes = await init_barcodes(); if (barcodes == null) barcodes = await init_barcodes();
}; };
function add_products_action() {
}
/** /**
* Init the page according to order(s) data (texts, colors, events...) * Init the page according to order(s) data (texts, colors, events...)
...@@ -1925,6 +1927,20 @@ function init_dom(partners_display_data) { ...@@ -1925,6 +1927,20 @@ function init_dom(partners_display_data) {
} }
}); });
$("#add_products_button").on('click', () => {
let pswd = prompt('Merci de demander à un.e salarié.e le mot de passe pour ajouter des produits à la commande');
// Minimum security level
if (pswd == add_products_pswd) {
console.log('ok');
// TODO
} else if (pswd == null) {
return;
} else {
alert('Mauvais mot de passe !');
}
});
// Barcode reader // Barcode reader
$(document).pos(); $(document).pos();
$(document).on('scan.pos.barcode', function(event) { $(document).on('scan.pos.barcode', function(event) {
......
...@@ -82,6 +82,7 @@ def produits(request, id): ...@@ -82,6 +82,7 @@ def produits(request, id):
"DISPLAY_AUTRES": getattr(settings, 'DISPLAY_COL_AUTRES', True), "DISPLAY_AUTRES": getattr(settings, 'DISPLAY_COL_AUTRES', True),
"ADD_ALL_LEFT_IS_GOOD_QTIES": False, "ADD_ALL_LEFT_IS_GOOD_QTIES": False,
"ADD_ALL_LEFT_IS_GOOD_PRICES": False, "ADD_ALL_LEFT_IS_GOOD_PRICES": False,
'add_products_pswd': getattr(settings, 'RECEPTION_ADD_PRODUCTS_PSWD', 'makeastop'),
} }
fixed_barcode_prefix = '0490' fixed_barcode_prefix = '0490'
......
...@@ -201,6 +201,7 @@ ...@@ -201,6 +201,7 @@
var display_autres = "{{DISPLAY_AUTRES}}"; var display_autres = "{{DISPLAY_AUTRES}}";
var add_all_left_is_good_qties = "{{ADD_ALL_LEFT_IS_GOOD_QTIES}}" var add_all_left_is_good_qties = "{{ADD_ALL_LEFT_IS_GOOD_QTIES}}"
var add_all_left_is_good_prices = "{{ADD_ALL_LEFT_IS_GOOD_PRICES}}" var add_all_left_is_good_prices = "{{ADD_ALL_LEFT_IS_GOOD_PRICES}}"
var add_products_pswd = "{{add_products_pswd}}"
</script> </script>
<script src="{% static "js/all_common.js" %}?v=1651853225"></script> <script src="{% static "js/all_common.js" %}?v=1651853225"></script>
<script src='{% static "js/barcodes.js" %}?v=1651853225'></script> <script src='{% static "js/barcodes.js" %}?v=1651853225'></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment