Odoo Help


2 Answers

Hello All,

I got solution.

pdf file dispaly on website page and also download it.

Here, I paste the code.

I hope it is useful to you also.

<!-- Display list of pdfs to download. -->

<div t-if="product.pdfs" class="row">
                            <b>Product Documents:</b>
                        <table width="100%" class="table table-responsive">
                            <t t-foreach="product.pdfs" t-as="i">
                                <tr t-if="i.pdf">
                                        <t t-esc="i.name" />
                                        <span align="center">
                                            <a t-att-href="'data:application/pdf;base64,%s' %i.pdf"
                                                <img style="height:25px;width:100px;"
                                                    src="/website_pdf_download/static/src/img/PDF-Download-Button.png" />

I hope this is useful to all of you.


Ivan อินโดนีเซีย


| 6 3 9
Jakarta, อินโดนีเซีย
Ivan อินโดนีเซีย
7/1/15 06:46

@Mohit, why don't you try to use ir.attachment instead?  Create one2many field from product to ir.attachment and then let ir.attachment handles the display using many2many_binary widget.

Ask a Question
Keep Informed
1 ผู้ติดตาม
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