mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user