fix regression introduced in 74810b6 (#72171)

This commit is contained in:
Pierre Ducroquet 2022-12-08 11:49:31 +01:00
parent cc48705afc
commit 11a4fe1e15
1 changed files with 5 additions and 3 deletions

View File

@ -2,15 +2,17 @@
{% load admin_urls i18n %}
{% block extrahead %}{{ block.super }}
{% if not change and not original.client %}
{% if add and not original.client %}
<script type="text/javascript">
window.addEventListener("load", function(){
let client_selector = document.getElementById("id_client");
let client_selector_start_value = client_selector.value;
client_selector.onchange = function() {
if (client_selector.value) {
if (client_selector.value && client_selector.value != client_selector_start_value) {
let new_url = window.location.origin + "{% url "admin:eo_facture_facture_add" %}?client=" + client_selector.value;
if (new_url != window.location)
if (new_url != window.location) {
window.location = new_url;
}
}
};
});