diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 954d17e450b..a9c200aa99e 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -705,6 +705,13 @@ if (!empty($usemargins) && $user->rights->margins->creer) } ?> + global->PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES)) { ?> + jQuery.each(data.array_options, function( key, value ) { + jQuery('div[class$="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); + }); + }, 'json' ); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 18ce5d12619..198d49defaf 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -192,7 +192,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) 'tva_tx' => $outtva_tx, 'qty' => $outqty, 'discount' => $outdiscount, - 'array_option'=>$object->array_options); + 'array_options'=>$object->array_options); } echo json_encode($outjson);