Commit e13eb617 by Damien Moulard

[REC] ask password to add products

parent ef12490f
......@@ -55,6 +55,7 @@ EM_URL = ''
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. \
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre."
DISPLAY_COL_AUTRES = False
......
......@@ -352,6 +352,11 @@
Password to enter to validate merge orders processing
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_FN = 'print_product_labels()'
......
......@@ -1750,7 +1750,9 @@ var get_barcodes = async function() {
if (barcodes == null) barcodes = await init_barcodes();
};
function add_products_action() {
}
/**
* Init the page according to order(s) data (texts, colors, events...)
......@@ -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
$(document).pos();
$(document).on('scan.pos.barcode', function(event) {
......
......@@ -82,6 +82,7 @@ def produits(request, id):
"DISPLAY_AUTRES": getattr(settings, 'DISPLAY_COL_AUTRES', True),
"ADD_ALL_LEFT_IS_GOOD_QTIES": False,
"ADD_ALL_LEFT_IS_GOOD_PRICES": False,
'add_products_pswd': getattr(settings, 'RECEPTION_ADD_PRODUCTS_PSWD', 'makeastop'),
}
fixed_barcode_prefix = '0490'
......
......@@ -201,6 +201,7 @@
var display_autres = "{{DISPLAY_AUTRES}}";
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_products_pswd = "{{add_products_pswd}}"
</script>
<script src="{% static "js/all_common.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