Skip to Content
Menu
This question has been flagged
1 Reply
2193 Views

when creating the stock-picking PDF from standard-action it works correct.

But we have some custom code that is called from external API-Call.

this function Creates some custom stock.pickiungs using sudo().

and then it prints the document/generates the Qweb pdf.

But using this logic no images from the product-Images will be shown in generated PDF.

in odoo-log i see the following:

2019-11-06 10:00:06,990 28910 INFO odoonewDB werkzeug: 127.0.0.1 - - [06/Nov/2019 10:00:06] "GET /web/image/product.product/387450/image_medium HTTP/1.0" 403 - 16 0.008 0.020
2019-11-06 10:00:06,990 28913 INFO odoonewDB odoo.addons.base.models.ir_model: Access Denied by ACLs for operation: read, uid: 4, model: product.product

So it seemt that the user who executes the wkhtmltopdf does not have the rights to see the images.

Why uid:4? (seems to be "Public" user).

regards





Avatar
Discard
Author Best Answer


in base/modeusl/ir_actions_report.py i found the method _run_wkhtmltopdf where the subprocess of wkthml will be startet.

within web browser wkhtml can now use 

'--cookie', 'session_id', request.session.sid
but it seems that this session is not an authorized session when calling from xmlrpc-API.


Avatar
Discard