Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
1854 Vizualizări

Hi all, I'm trying to put image (client signature) inside pdf quote builder but without luck. Did anybody know the trick how to do this?  I made this simple extension to enrich PDF with values. If I use form field in PDF I see base64 string. If I use image tag it will remains empty. 

from odoo import models


class IrActionsReport(models.Model):
    _inherit = 'ir.actions.report'

    def _get_form_fields_mapping(self, order, doc_line_id_mapping=None):
        result = super()._get_form_fields_mapping(order, doc_line_id_mapping=doc_line_id_mapping)
        result.update({
            'signed_on': order.signed_on,
            'date_order': order.date_order,
            'customer_signature': order.signature,
            'user_signature': order.user_id.sign_signature,
        })

        return result

Imagine profil
Abandonează
Cel mai bun răspuns

Hello Stanislav Kurniec,


Did you tried with converting order signature in base64 

signature_image = order.signature.decode('base64')
signature_base64 = base64.b64encode(signature_image).decode('utf-8')

use signature_base64 in result.



I hope this will help you

Thanks,

Vimal Rughani (Founder and CTO)

Himanjali Intelligent Automation Pvt Ltd

Contact: +91- 972-606-7737

Emailhello@himanjali.com 

NewsletterThe Odoo Scoop

Websitewww.himanjali.com

 


Imagine profil
Abandonează
Cel mai bun răspuns

Did you solve it?

Imagine profil
Abandonează
Autor

No I didn't but in Odoo 18 it should be possible to require signature almost every where so I hope this will solved it. Maybe if you try to dig inside signature there is some way how Odoo adds some area to PDF and then fill it with image maybe this will be the way how to do it.
I have data but I didn't find out the way how to correctly display it inside PDF.

Related Posts Răspunsuri Vizualizări Activitate
3
apr. 24
2142
1
dec. 24
1327
6
dec. 24
4237
1
mar. 24
2507
2
aug. 25
298