Odoo Help


[SOLVED] AttributeError: 'module' object has no attribute 'create_single_pdf'

on 11/17/14, 9:06 AM 4,454 views

Hey everybody

Today I started to migrate the module 'Terms and Conditions' (https://www.odoo.com/apps/7.0/agaplan_terms_and_conditions/) from V7 to V8 since the module is not released for V8.
I've managed to change the settings from V7 to V8 but I'm puzzled with one error.

The code in aga_plan_terms_and_conditions in the file report_sxw.py:

from openerp.osv import osv
from openerp import pooler
from openerp.report import report_sxw
from openerp.tools.safe_eval import safe_eval
#from tools.safe_eval import safe_eval

import time
import base64
import logging

    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

    from pyPdf import PdfFileWriter, PdfFileReader
except ImportError:
    raise osv.except_osv(
        "agaplan_terms_and_conditions needs pyPdf",
        """To install the module "agaplan_terms_and_conditions" please ask your administrator to $

# We store the original function
openerp_create_single_pdf = report_sxw.create_single_pdf

The error happens in the line openerp_create_single_pdf = report_sxw.create_single_pdf.. I've looked under tools/report/report_sxw.py and the method create_single_pdf does exist.
Could anybody tell me what is wrong or what I'm missing? I'd love to get this module working in V8..

I will release the working module 'Terms and Conditions' to the public if I get this working.

With kind regards



| 8 8 8

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 11/17/14, 9:43 AM

I've managed to fix this. The problem was that I had my import wrong. I had this:

from openerp.report import report_sxw

And I should have had this:

from openerp.report.report_sxw import report_sxw

But now rises my second problem.. The code isn't giving me ANY errors but there is no second page added to the PDF when I print.
What am I missing or what am I doing wrong?

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: 11/17/14, 9:06 AM
Seen: 4454 times
Last updated: 3/16/15, 8:10 AM