Odoo Help

Welcome!

This community 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.

0

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

By
Yenthe
on 11/17/14, 9:51 AM 1,056 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

try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

try:
    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
Yenthe

Still no solution found.. Anybody? :s

Yenthe
on 4/27/15, 5:27 AM
0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

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

Bole
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?

Yenthe
on 11/18/14, 9:38 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/17/14, 9:51 AM
Seen: 1056 times
Last updated: 4/27/15, 5:27 AM