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

error on custom module install

By
Raquel Jeanne Corpuz Gumtang
on 2/17/14, 12:34 AM 419 views

Hi, I'm trying to port custom modules to OpenERP 7 but I am encountering a module trying to import web.common. I understand that this folder is not in v7 anymore. Does anyone know how I can rewrite this module so it can be installed to v7? here is the affected code:

try: # embedded from openerp.addons.web import common import openerp.addons.web.common.http as openerpweb from openerp.addons.web.controllers.main import Reports except ImportError: # standalone from web import common import web.common.http as openerpweb from web.controllers.main import Reports

class custom_class_name(inherited_class_name):

class PrintOutFileName(Reports): # URL defined in addons/custom_module/static/src/views.js _cp_path = "/fs3_web_printout/report"

@openerpweb.httprequest
def index(self, req, action, token):
    action = simplejson.loads(action)

    report_srv = req.session.proxy("report")
    context = req.session.eval_context(
        common.nonliterals.CompoundContext(
            req.context or {}, action[ "context"]))

    report_data = {}
    report_ids = context["active_ids"]
    if 'report_type' in action:
        report_data['report_type'] = action['report_type']
    if 'datas' in action:
        if 'ids' in action['datas']:
            report_ids = action['datas'].pop('ids')
        report_data.update(action['datas'])

I hope you can help me find another way to import what is needed by the code in web.common. Thank you!

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

0 follower(s)

Stats

Asked: 2/17/14, 12:34 AM
Seen: 419 times
Last updated: 3/16/15, 8:10 AM