-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report cannot be generated in Odoo 16 #88
Comments
maybe this cold be the beginning of an explanation : odoo-java/odoo-java-api#17 |
In fact it's not possible anymore since Odoo 14.0. Things are:
So we will probably need to still call |
maybe we could work with access_token provided by potal_mixin : https://github.com/odoo/odoo/blob/16.0/addons/portal/models/portal_mixin.py#L15 |
Would it make sense to implement the call to the following URL /report/pdf/<report_name>/ |
sure @pfranck but we still stucked on getting a proper connexion to avoid crsf issues ;-) |
import odoorpc
# Prepare the connection to the server
odoo = odoorpc.ODOO('myserver.odoo.com', port=443, protocol='jsonrpc+ssl')
db = "dbname"
username = "admin"
password = "admin"
# Login
odoo.json("/web/session/authenticate", {"db": db, "login": username, "password": password})
r = odoo.http("/report/pdf/account.report_invoice/15781")
assert r.status == 200
with open("report.pdf", "wb") as f:
f.write(r.read()) |
Great thanks to you @em230418 I'll test this ASAP |
With Odoo Version 16 reports cannot be downloaded.
Steps to reproduce the behavior:
Traceback (most recent call last):
File "main.py", line 10, in
report = odoo.report.download('lg_reports.rechnung_qr_report_template', 1650)
File "/home/pi/.local/lib/python3.5/site-packages/odoorpc/report.py", line 133, in download
response = report.with_context(context).render(ids, data=datas)
File "/home/pi/.local/lib/python3.5/site-packages/odoorpc/models.py", line 405, in rpc_method
self._name, method, args, kwargs)
File "/home/pi/.local/lib/python3.5/site-packages/odoorpc/odoo.py", line 486, in execute_kw
'args': args_to_send})
File "/home/pi/.local/lib/python3.5/site-packages/odoorpc/odoo.py", line 285, in json
data['error'])
odoorpc.error.RPCError: type object 'ir.actions.report' has no attribute 'render'
The text was updated successfully, but these errors were encountered: