This question has been flagged
6 Replies
68153 Views

Hi,

 

I extended the 'report.external_layout_footer' qweb view to display image.

Below is my code in the file reports/external_layout.xml:

        <template id="report_footer_custom" inherit_id="report.external_layout_footer">
            <xpath expr="//div[@class='footer']" position="replace">
                <div class="footer">
                        <img t-att-src="'data:image/jpeg;base64,/var/www/cbl_openerp/openerp/cap_addons/cap_sale/img/footer.jpeg'"/>
                        <ul class="list-inline">
                            <li>Page:</li>
                            <li>
                                <span class="page"/>
                            </li>
                            <li>/</li>
                            <li>
                                <span class="topage"/>
                            </li>
                        </ul>
                    </div>
            </xpath>
        </template>

 

 

And here is my __openerp__.py content :

    ...
    "depends": ["base","sale","report"],
    ...
    "data": ['sale.xml',
            'reports/reports.xml',
            'reports/external_layout.xml',
            'reports/informations_prestation.xml',
            'views/product_template.xml',
            'filter.xml'],
    ...
    "images":['img/footer.jpeg',],
    ...

 

But when I print a sale order, i can't view my image at the bottom of the page.

Does anyon has already faced this issue ?

 

Thank you for your help

 

Avatar
Discard
Best Answer

Hello Victor,



remove this line

<img t-att-src="'data:image/jpeg;base64,/var/www/cbl_openerp/openerp/cap_addons/cap_sale/img/footer.jpeg'"/>

Your image should be saved inside static/src/img/image name

Try this code hope very help full.

<img src='/module name/static/src/img/image name with extention' style="max-height: 45px;"/>

if you find this answer helpful, please give me a thumbs up vote    

Thanks & Regards,

Ankit H Gandhi

Avatar
Discard
Author

HI, thanks for your help. I tried your solution, but it didn't change anything. I still can't see any image in the pdf generated...

update code.@Victor

Upgrading the module after restarting the server may work.

Best Answer

The Below link should helpful for solve your Question

http://stackoverflow.com/questions/28561121/display-image-in-qweb-report/28628727#28628727

 

I hope this should helful for you ..:)

 

Avatar
Discard