Skip to Content
Menu
This question has been flagged
2 Replies
1641 Zobrazenia

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

Avatar
Zrušiť
Best Answer

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

 


Avatar
Zrušiť
Best Answer

Did you solve it?

Avatar
Zrušiť
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 Replies Zobrazenia Aktivita
3
apr 24
1897
1
dec 24
1095
6
dec 24
3782
1
mar 24
2301
1
júl 25
400