0

I'm trying to insert the logo of my client on the "Quotation/Order" report. I already got to insert the logo of the contacts of the clients using the code below on the report_saleorder_document view:

<img t-if="doc.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>

The problem is: the logo is not present on the partner_id, but it is stored on the parent.partner_id

I already tried the code below, but not working.

<img t-if="doc.parent.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.parent.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>

Any suggestion?

Rob
  • 14,746
  • 28
  • 47
  • 65
  • Could you please let us know whether the field named "parent" exists in same model where you about to downloading the report.? – Sakthi Priya Oct 22 '21 at 17:46

2 Answers2

1

I got it by myself... thanks Saks_here!

1 - enter developer mode
2 - Menu Technical/User Interface/Views
3 - Find the views you need to duplicate (in my case report_saleorder and report_saleorder_document)
4 - Enter on the view and click in Action/Duplicate and change the "view name" on the top of the screen and laso the t-name on the Archetecture
5 - Menu Technical/Sequence & Identifiers/External Identifires
6 - Find the External Idendifiers you want to duplicate (i used a new browser tab to facilitate copy and paste the info)
7 - Click on Create and views, changing the "external identifier" to the name you need
8 - using a database query, find the id of the views you have created on step 4
9 - go back to the identifiers you have cretaed and replace the "record id" with the id you got on step 8
10 - Menu Technical/Actions/Reports
11 - CLick on the report you want to duoplicate
12 - Click in Action/Duplicate and chenge: Name, Template Name and Printed Report Name and save it
13 - click in Qweb views, you will finde the reports you have created
14 - modify the reports using the archtecture tab

0

In sale, while clicking on partner_id, you will have partner's name and its parent company's name. If you want to show the logo of parent company in sale Quotation or order report,

Code:

<img style="height:2cm;width:2cm;" t-if="doc.partner_id.parent_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.parent_id.image_256}}" class="img img-responsive" alt="User Image"/>
Sakthi Priya
  • 209
  • 4
  • 19
  • I have a new question (probably the last onw before migrate my data form 7 to 15): Is there any way to duplicate the Quotation/Order report, than modify the copied report removing info that I do not need? The Quotation/Order report is great for sending to cleints... but after selling, I need to create a "packing label report" in order to mark my packing boxes with few information before the truck to collect it: cliente logo, cliente name, order number, client address... Cheers – Eduardo Marzolla Oct 22 '21 at 23:40
  • There is a way to duplicate report twice on single pdf while downloading. Kindly let me know , Is that how you want? – Sakthi Priya Oct 23 '21 at 05:08
  • https://stackoverflow.com/questions/69373776/how-can-i-print-duplicate-qweb-report-in-odoo – Sakthi Priya Oct 23 '21 at 05:11
  • Thanks for answering. I do not want to print the same report twice... I really need to duplicate the report in order to modify the copied report, keeping the original report without any change... thanks again – Eduardo Marzolla Oct 23 '21 at 11:00
  • Kindly let me know whether my understanding is right or not. In sale, you are having two records and clicks print button. There you need some pop up to change records but not in form. The report you downloaded must show the edited one from pop up window not from form . Is it so... – Sakthi Priya Oct 23 '21 at 12:53
  • Where do you want to modify records.. – Sakthi Priya Oct 23 '21 at 12:55