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

Error when running a report from an odoo view based models #58

Open
JosDeGraeve opened this issue May 21, 2015 · 0 comments
Open

Error when running a report from an odoo view based models #58

JosDeGraeve opened this issue May 21, 2015 · 0 comments

Comments

@JosDeGraeve
Copy link

Some odoo models are based on a postgresql view such as stock.history. ( Stock Value At Date )

this view creates an id column consisting of a concatenation of 2 id's resulting in a string value.

This triggers the error below when you try to run a report on records of this view:

2015-05-21 12:32:30,449 13500 ERROR neolabo report_aeroo: Report generation error!
Traceback (most recent call last):
  File "/Users/josdg/Workspace/Projects/neolabo/addons-extra/report_aeroo/report_aeroo.py", line 580, in create_aeroo_report
    data = basic.generate(**oo_parser.localcontext).render().getvalue()
  File "/Library/Python/2.7/site-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/base.py", line 51, in render
    return self.serializer(self.events)
  File "/Library/Python/2.7/site-packages/aeroolib-1.2.0-py2.7.egg/aeroolib/plugins/opendocument.py", line 1209, in __call__
    for kind, data, pos in stream:
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/markup.py", line 326, in _match
    for event in stream:
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/base.py", line 578, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/base.py", line 289, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/eval.py", line 177, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "<string>", line 1, in <Expression u'__filter(o.product_id.name)'>
  File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.10-intel.egg/genshi/template/eval.py", line 317, in lookup_attr
    val = getattr(obj, key)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/fields.py", line 817, in __get__
    self.determine_value(record)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/fields.py", line 910, in determine_value
    record._prefetch_field(self)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/models.py", line 3223, in _prefetch_field
    result = records.read(list(fnames), load='_classic_write')
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/models.py", line 3168, in read
    self._read_from_database(stored, inherited)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/models.py", line 3291, in _read_from_database
    cr.execute(query_str, [tuple(sub_ids)] + where_params)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/Users/josdg/Workspace/Projects/neolabo/odoo/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: text = integer
LINE 2:                         WHERE "stock_history".id IN (8736, 8...
                                                         ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

Regards,
Jos

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