Product Module - Complementary attributes

Hi, i am on Dolibarr 18.0.3.

I am unable to find the right method to display the product - complementary attributes to the odt template. I tried to use all proposed method in the forum like:

  1. {line_options_<attribute_code>}
  2. {object_options_<attribute_code>}

No value, but {object_options_} work in proposal module.

Pls help… thank you

Hello,

Just read the wiki : Create an ODT document template - Dolibarr ERP CRM Wiki

You have to use :

{line_product_options_xxx} : If the line is a product, Value of the Product extra filed (where xxx is code of Product extra field)

Have tried all combination, does not output any value for the complementary attribute.

Do I need to declare any code for extrafields for the product.php?

Hello,

Normally not it’s automatic.

Most probably something wrong on your ODT.

Hi,
I have re-create a new odt with the following, still no value output.

{object_product_label}
{object_options_engineno}
{object_options_carmanufacturers}
{object_options_manufactured}

[!-- BEGIN row.lines --]

{line_product_options_engineno}
{line_test}
{line_product_test}

[!-- END row.lines --]

Do i need to add the following code to htdocs/mymodule/core/substitutions/functions_mymodule.lib.php* ?

function mymodule_completesubstitutionarray(&$substitutionarray,$langs,$object)
{
global $conf,$db;

$myvalue=‘Put here calculated value to insert’;
$substitutionarray[‘myowntag’]=$myvalue;
}