[SOLVED] {line_options_xxx} in ODT files broke

In Dolibarr 8.x the use of {line_options_xxx} in ODT files for proposals, orders and shipment works fine. After upgrading to 9.0.1 none of the ODT templates work anymore.
{line_options_xxx} isn’t filled out anymore

EDIT: Thanks to ksar:
Code changed since V9

So up to V8 use
{line_options_xxxx}
Above V9 use
{line_product_options_xxxx}

Hi,

Open in Github : https://github.com/Dolibarr/dolibarr/issues/10521

I know. I added the issue but I can not see if it has been assigned for resolving.
Therefore I hoped to get some solutions form the forum.

Try typing out the {line_options_xxx} in the ODT file again and uploading the same.

Hi,

You mean it is working for you ?

No result.
{line_options_xxx} is not filled out.

{object_options_xxx} is working fine for me on Dolibarr 9.0.1

Try testing out by defining a new line options and inserting that field in your ODT. This would at least help in ruling out if the option is working altogether or if there is a bug

Hi,

I have just test on my 9.0.1 and it is working great.

Could you please send a screenshot of the extrafield configuration and the odt file ?

Thanks.

Here are the 9.0.1 screenshots

I added a new extra field in the products.
Doesn’t work either

Pièces jointes :

I see nothing attached…

Second attempt

Hi,

THis is completely normal that it doesn’t work.
You have created your extrafield on product.
And you try to display it as it was a line delivery extrafield

Impossible !

Same template but used in Dolibarr 8.0.4
So where is impossible now!

The extrafield configuration is different, with the screens above it should not work.
You have other extra field configured

Thanks for your help.
But it’s exactly the same template
But in an earlier reply som e one asked to add a new field and use that one in the template to exclude that it was my extra filed configuration.
That’s why there is an extra field called test and I used that one in the template.

Other than that it is the exact same configuration and template

HI,

I finally find some times to analyse your case.

After a review of the code there is a change between V8 and V9 :
V8 : https://github.com/Dolibarr/dolibarr/blob/8.0/htdocs/core/class/commondocgenerator.class.php#L550
V9 : https://github.com/Dolibarr/dolibarr/blob/9.0/htdocs/core/class/commondocgenerator.class.php#L580

So the Product Extra field of a line changed from {line_xxxx} to {line_product_xxxx}

Could you try ?

Hi,

First of all, thanks for helping me out.

I change {line_options_xxx} to {line_product_xxx} where xxx is the name of the attribute code --> no result
Then I change {line_options_xxx} to {line_product_options_xxx} where xxx is the name of the attribute code --> no result

HI,

Just to be sure, you have done it on a V9 ?

Hi,

I have just made the test and I confirm that if you have a product extrafiled defined and that you use the product on a proposal, on the ODT file the {line_product_options_xxxx} is working !

So up to V8 use {line_options_xxxx}
Above V9 use [code]
{line_product_options_xxxx}[/code