Odoo Help


I want To download payslip report from this script. But It shows 500 internel Server Error? Help me to find right code for this?

on 5/20/16, 3:14 AM 425 views

import xmlrpclib

import time

import base64

username = 'admin' # The Odoo user

pwd = '*******'# The password of the Odoo user

dbname = 'YesRegulatorySandBox' # The Odoo database

# OpenERP Common login Service proxy object

sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')

uid = sock_common.login(dbname, username, pwd)

sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/report')

report_id = sock.report(dbname, uid, pwd, 'hr.payslip', [1], {'model': 'hr.payslip', 'id': 1, 'report_type': 'qweb-pdf'})


state = False

attempt = 0

while not state:

report = sock.report_get(dbname, uid, pwd, report_id)

state = report['state']

if not state:


attempt += 1

if attempt > 200:

print 'Abort, too long delay'

pdf_string = base64.decodestring(report['result'])

pdf_file = open('/tmp/report/file.pdf', 'w')



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/20/16, 3:14 AM
Seen: 425 times
Last updated: 5/20/16, 3:31 AM