FIX: reloading supplier proposal page whenselecting company is not working (#29662)

This commit is contained in:
jyhere 2024-05-15 18:31:51 +02:00 committed by GitHub
parent 2f8e7dabf2
commit cd1eed123c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1277,14 +1277,14 @@ if ($action == 'create') {
$filter = '((s.fournisseur:=:1) AND (s.status:=:1))';
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company((empty($socid) ? '' : $socid), 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer information
if (getDolGlobalString('RELOAD_PAGE_ON_SUPPLIER_CHANGE')) {
if (!getDolGlobalString('RELOAD_PAGE_ON_SUPPLIER_CHANGE_DISABLED')) {
print '<script>
$(document).ready(function() {
$("#socid").change(function() {
console.log("We have changed the company - Reload page");
// reload page
$("input[name=action]").val("create");
$("form[name=add]").submit();
$("form[name=addprop]").submit();
});
});
</script>';