Merge branch 'Aufinal/fix_history' into 'master'

Fix asynchronous calls with resetSettings

See merge request !229
This commit is contained in:
Aurélien Delobelle 2017-05-15 23:43:28 +02:00
commit 95a8b484e0

View file

@ -182,7 +182,7 @@ $(document).ready(function() {
settings = {} settings = {}
function resetSettings() { function resetSettings() {
$.ajax({ return $.ajax({
dataType: "json", dataType: "json",
url : "{% url 'kfet.kpsul.get_settings' %}", url : "{% url 'kfet.kpsul.get_settings' %}",
method : "POST", method : "POST",
@ -191,7 +191,6 @@ $(document).ready(function() {
settings['addcost_for'] = data['addcost_for']; settings['addcost_for'] = data['addcost_for'];
settings['addcost_amount'] = parseFloat(data['addcost_amount']); settings['addcost_amount'] = parseFloat(data['addcost_amount']);
settings['subvention_cof'] = parseFloat(data['subvention_cof']); settings['subvention_cof'] = parseFloat(data['subvention_cof']);
displayAddcost();
}); });
} }
@ -1431,9 +1430,11 @@ $(document).ready(function() {
resetArticles(); resetArticles();
resetPreviousOp(); resetPreviousOp();
khistory.reset(); khistory.reset();
resetSettings(); resetSettings().done(function (){
getArticles(); getArticles();
getHistory(); getHistory();
displayAddcost();
});
} }
function resetSelectable() { function resetSelectable() {