Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3622 Ansichten

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

Avatar
Verwerfen
Autor

Still no solution found.. Anybody? :s

Beste Antwort

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;)

Avatar
Verwerfen
Autor

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

Verknüpfte Beiträge Antworten Ansichten Aktivität
1
März 22
7759
0
Apr. 24
2141
0
Feb. 21
3417
0
Juni 20
2823
1
Mai 20
9889