NEW: Automatically fill matching extra fields of object on line creation. (#27240)

* Update objectline_create.tpl.php - Auto-fill matching extra fields

This change allows to automatically fill the matching extra fields in a form when adding an object (product/service).

* Change spaces to tabs.
This commit is contained in:
Finta
2024-02-12 05:38:51 +01:00
committed by GitHub
parent e89f93024f
commit e89dd3bfaa

View File

@@ -833,6 +833,17 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
jQuery("#price_ht").val(data.price_ht);
}
// Set values for any fields in the form options_SOMETHING
for (var key in data.array_options) {
if (data.array_options.hasOwnProperty(key)) {
var field = jQuery("#" + key);
if(field.length > 0){
console.log("objectline_create.tpl set content of options_" + key);
field.val(data.array_options[key]);
}
}
}
var tva_tx = data.tva_tx;
var default_vat_code = data.default_vat_code;