Wassim Benkoulal
Wassim Benkoulal

Reputation: 3

How can i Add e-sign in an attached PDF Odoo14

i'm using Odoo14 CE, i add

class dossier(models.Model):
   _inherit = 'purchase.order'
    ​Proformat_fournisseur = fields.Binary(string="Proformat fournisseur", attachment=True, index=True, tracking=1, store=True)

so user can add proformat (sent by the supplier) in the purchase order, user should confirm the purchase, e-sign that proformat already sent by the supplier and saved in th field "Proformat_fournisseur"

I already scanned the signature of the user, i can add it in the qweb report generated by Odoo such the purchase order report, but the signature should be on the buttom of the proformat sent by the supplier. so user can send it to supplier by mail later.

I set the report_purchasequotation_document to this just to test it:

<?xml version="1.0"?>
<t t-name="purchase.report_purchasequotation_document">
   <t t-call="web.basic_layout">
            <t t-foreach="docs" t-as="doc">
                <div class="page">
                    <t t-if="doc.Proformat_fournisseur">
                        <!-- Embed the Proformat PDF -->
                        <div>
                            <iframe
                                t-att-src="'data:application/pdf;base64,' + doc.Proformat_fournisseur.decode('utf-8')"
                                style="width: 100%; height: 1000px; border: none;">
                            </iframe>
                        </div>
                    </t>
                </div>
            </t>
        </t>
</t>

i expected it will print the PDF stored in Proformat_fournisseur, but i got just an empty page.

i'm open to other suggestions !

thank you for reading.

Upvotes: 0

Views: 46

Answers (0)

Related Questions