Odoo Help


How to add product image in RFQ report?

Seah Hui Jing
on 2/4/14, 2:00 PM 2,480 views

Hi. I'm trying to add a new field: Product Image, into the RFQ report. Please guide me on what should I insert into the RML/ SXW file.

Also, is it possible to add item number (auto increment) in RFQ report too?

Example: I request for 3 items: Flour, Sugar & Baking Powder. Thus, the report would show:

  1. Flour (Price) (Weight) ETC
  2. Sugar (Price) (Weight) ETC
  3. Baking Powder (Price) (Weight) ETC
On 3/21/17, 3:26 AM

<td><span t-field="l.product_id.image_small" t-options='{"widget": "image"}'/></td>

single line code for showing product images in sales report.


Luke Branch

--Luke Branch--
| 7 8 8
Mui Wo, Lantau, Hong Kong
--Luke Branch--


Luke Branch
On 7/4/14, 8:19 AM

If you are looking to add a product image to a printed report (ie. PDF or HTML) sales order, purchase order, invoice, or any other report with product order lines I believe I have figured out a solution thanks to Fabrice Henrion's post here: https://www.odoo.com/forum/Help-1/question/Is-there-any-way-to-preview-WebKit-report-layout-while-coding-maybe-WYSIWYG-Editor-52307.

Simply follow Fabrice's instructions as follows (preferably use latest v8 master branch version):

  1. First you have to know that the new QWeb engine allows to output PDF or HTML. It is only when the output is HTML that it can be modified in a WYSIWYG fashion.
  2. Let's assume the Sales module is installed on a fresh Odoo instance. By default, the output of a quotation document is PDF, you can test that by printing a quotation. We want to change this.
  3. Make sure your user has the technical feature checkbox checked. Then go to Settings > Technical > Reports > Reports, then search "sale.order" and enter the record.
  4. Edit the Report Type from PDF to HTML, then Save.
  5. Go back to the Sales app and print a quotation.
  6. A popup appear (or your popup-blocker will notify you). You will see the quotation in that popup and a black bar at the top with the Edit button. You need to make sure you have the access right to edit this so I recommend you do this test as an admin.
  7. From there, it's pretty straightforward. You edit whatever you want. You have to realize that there are 2 types of edition on a record like this: editing this particular record, or editing the quotation template which will have an impact on all records. For example, if you edit a header, it will be a template edition.

If you want to add an image to an order line simply edit the HTML in the HTML editor found in the top navigation menu under Customize >> HTML Editor and find the place in the HTML/QWeb template that you would like to edit. I simply added an extra set of <th></th> tags as follows for a order line header (in the appropriate section of html/qweb that is):

<th class="text-left"><strong>Picture</strong></th>

and then added the following line for the sales order line product picture column:

                                <td class="text-center">
                                   <span t-field="line.product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>

The contents of the <span> tag pull the product image into the sales order line in the column that you want and when you save your html your report will display the appropriate product picture in 64px x 64px.

There may be a better way to do this and I welcome any comments on how this process might be improved.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/4/14, 2:00 PM
Seen: 2480 times
Last updated: 3/21/17, 3:26 AM