parent
cc48705afc
commit
11a4fe1e15
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue