Help

1

How to add a product description to BOM Structure report?

Avatar
Alex Gallien

Hi,

I am trying to add a the product description field to my BOM Structure report (using the OpenOffice plugin), but can't figure out how to reference it. I am specifically referring to the large text field when editing a product under the "Information" tab. With developer tools on it says:

Field: description
Object: product.product
Type: text

It seems like [[ repeatIn(get_children(o.bom_lines), 'l') ]] is defining each product in the BOM line as 'l', so I tried putting in (l.description), (l.product.description), l['description'], and a few other variants, to no avail. Does anyone know the correct way to reference this? Or any references I could use to understand the syntax here better? Thanks.

Avatar
Discard
4 Answers
3
Avatar
Nehal
Best Answer

Hi,

For getting description of bom_lines, you need to add following : get_children method of mrp/report/bom_structure.py file:

res['pname'] = l.product_id.name # already there
res['pdesc'] = l.product_id.description  # add this line

Then in your rml file you can get description by adding following line:

<para style="terp_default_9">[ [[ (l['pdesc']) ]] ]</para>

Hope this may solve your issue.

Avatar
Discard
0
Avatar
Quang Huynh
Best Answer

Dear Nehal,

    How can I insert product's dimension into BoM & structure report also.

   Note: product's dimension input from product template.

Thanks,

Avatar
Discard
0
Avatar
Alex Gallien
Best Answer

That's exactly it Nehal, thank you so much. I should have looked deeper in the /mrp/ folder. Cheers!

Avatar
Discard
0
Avatar
faber
Best Answer

This method does not work in ODOO8, and look forward to solutions.

Avatar
Discard