Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameters provided for this report are not valid #301

Open
jesus-escobedo opened this issue Apr 4, 2018 · 0 comments
Open

The parameters provided for this report are not valid #301

jesus-escobedo opened this issue Apr 4, 2018 · 0 comments

Comments

@jesus-escobedo
Copy link

jesus-escobedo commented Apr 4, 2018

Hi everybody, I´m a newbie at pentaho reports and actually I´m updating some existing reports for OpenERP/Odoo (v8), until now all the changes I have made, have been directly modifying the inside files of the .prpt package, like modifying the order of columns or adding some more, but now I am trying to pass a new variable from the python code that calls the pentaho report in order to condition the existing query of the report, but so far all my tryings end up with "The parameters provided for this report are not valid".
The new parameter that I´m sending from the python function is a variable that obtains its value from a computed field.

Exception:

openerp.service.report: Exception: <Fault 0: 'Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: The parameters provided for this report are not valid.'>
Traceback (most recent call last):
  File "/opt/odoo/openerp/service/report.py", line 93, in go
    result, format = openerp.report.render_report(cr, uid, ids, object, datas, context)
  File "/opt/odoo/openerp/report/__init__.py", line 40, in render_report
    return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context)
  File "/opt/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/openerp/addons/base/ir/ir_actions.py", line 155, in render_report
    return new_report.create(cr, uid, res_ids, data, context)
  File "/opt/odoo/addons/pentaho_reports/core.py", line 261, in create
    rendered_report, output_type = report_instance.execute()
  File "/opt/odoo/addons/pentaho_reports/core.py", line 201, in execute
    return self.execute_report()
  File "/opt/odoo/addons/pentaho_reports/core.py", line 239, in execute_report
    rendered_report = proxy.report.execute(proxy_argument).data
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1306, in single_request
    return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1482, in parse_response
    return u.close()
  File "/usr/lib64/python2.7/xmlrpclib.py", line 794, in close
    raise Fault(**self._stack[0])
Fault: <Fault 0: 'Failed to invoke method execute in class com.willowit.reporting.PentahoRenderer: The parameters provided for this report are not valid.'>

Python Code:

def get_user(self, cr, uid, ids, name, arg, context=None):
        user = self.pool.get('res.users').browse(cr, uid, uid)
        if user.has_group('hr.emp_groups_32'):
            return True
        else:
            return False

'make_visible':fields.function(get_user, string="User Visible", type="char", obj="generic.request"),

Python Function to call report:

def print_report_one(self, cr, uid, ids, context=None):
        rep_obj = self.pool.get('ir.actions.report.xml')
        for case in self.browse(cr, uid, ids):
            data = {}
            data['ids'] = context.get('active_ids', [])
            data['model'] = context.get('active_model', 'ir.ui.menu')
            data['output_type'] = case.output_type
            data['variables'] = {
                                'status_type'    : case.status_type or '',
                                'employment_status': case.employment_status or '',
                                'output_type' : case.output_type or '',
                                'make_visible' : case.make_visible,
                                }
            print data
            return {
                    'type': 'ir.actions.report.xml',
                    'report_name':'report_one',
                    'datas':data,
                    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant