Merge pull request #8185 from BitKFu/develop

NEW Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
This commit is contained in:
Laurent Destailleur 2018-02-14 20:56:00 +01:00 committed by GitHub
commit f3ffc7ce8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -527,7 +527,16 @@ abstract class CommonDocGenerator
$line->fetch_optionals($line->rowid,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
if (isset($line->product_ref))
{
$product = new Product($this->db);
$result = $product->fetch(null, $line->product_ref);
foreach($product->array_options as $key=>$label)
$resarray["line_".$key] = $label;
}
return $resarray;
}