Odoo Help


How to upgrade code for Terms and Conditions module from V7 to V8? [+-95% done]

on 11/17/14, 9:51 AM 1,361 views

Hey everybody

Today I'm in need of the 'Terms and Conditions' module, but sadly this is not supported in Odoo V8.
Due to this reason I have chosen to rewrite the module to make it work in V8. I've managed to update the code to work with V8 but when I add a new file it is not being added to the PDF...
I've updated the code in the file report_sxw.py in the agaplan_terms_and_conditions.py file and this now looks like this:

from openerp.osv import osv
from openerp import pooler
from openerp.report.report_sxw 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 install the pyPdf package."""

# We store the original function
openerp_create_single_pdf = report_sxw.create_single_pdf


This is all that had to be upgraded. Can anybody tell me why the files are not added to the PDF? The module is giving no errors and is just running smooth. I can add new terms, save them and everything is fine but it is just not printing the extra pages.
Does anybody have any idea or help? I'm out of ideas.

Edit: After trying out the --debug-level and closefully monitoring the only unusual thing I could find was this:

openerp.addons.base.ir.ir_sequence: ir_sequence.get() and ir_sequence.get_id() are deprecated. Please use ir_sequence.next_by_code() or ir_sequence.next_by_id().

Could this be the problem why it is not modified? I do not know how or where to fix this though..

The updated code, for V8, will be shared with the public and will be sent to Odoo so they hopefully add it to the apps for v8.

With kind regards

Still no solution found.. Anybody? :s

on 4/27/15, 5:27 AM



| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 11/18/14, 9:33 AM

Check under : Setting -> Technical -> Actions -> Reports, 
Find your new report, and look if field Reload from attachment is checked.. 
If so.. uncheck.. and try again;)

@Bole sadly the field 'Reload from attachment' is not checked on my report. I've made this rule in the 'Terms and Quotations module': http://i.imgur.com/CD0PC82.png And when I go to settings > technical > actions > reports and search for 'sale.report_saleorder' the checkmark is unchecked by default. As you can see here: http://i.imgur.com/0T0Sjo6.png Did you manage to get it working or do you know another solution?

on 11/18/14, 9:38 AM

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:51 AM
Seen: 1361 times
Last updated: 4/27/15, 5:27 AM