Odoo Help


Error when using custom 'GROUP BY' filter

Marco Cid
on 11/21/14, 6:55 PM 2,076 views


Im triying to create custom group by filters for my module, but im getting the following error message:

Traceback (most recent call last):
  File "/opt/openerp/70/openerp_prod/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/70/openerp_prod/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/70/openerp_prod/server/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/70/openerp_prod/server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/70/openerp_prod/server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/70/openerp_prod/server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/70/openerp_prod/server/openerp/osv/orm.py", line 2740, in read_group
    cr.execute(query, where_clause_params)
  File "/opt/openerp/70/openerp_prod/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/openerp/70/openerp_prod/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: syntax error at or near "GROUP"
LINE 6:             GROUP BY "trabis_lead_tendency_report_base"."com...


Apparently the query is wrong:

"SELECT min(trabis_lead_tendency_report_base.id) AS id, count(trabis_lead_tendency_report_base.id) AS company_name_count, "trabis_lead_tendency_report_base"."company_name" as company_name
            FROM "trabis_lead_tendency_report_base"
            GROUP BY "trabis_lead_tendency_report_base"."company_name"
            ORDER BY company_name"

There is nothing after the 'WHERE'


This is my filter view:

      <record id="view_lead_tendency_rec_search" model="ir.ui.view">
            <field name="name">trabis.lead.tendency.report.base.search</field>
            <field name="model">trabis.lead.tendency.report.base</field>
            <field name="arch" type="xml">
                <search string="Busqueda registro iniciativas">
                    <field name="company_name"/>
                    <field name="month_name"/>
                    <field name="date_year"/>
                    <group expand="0" string="Group By...">
                        <filter string="company_name" domain="[]" context="{'group_by':'company_name'}"/>
                        <filter string="month_name" domain="[]" context="{'group_by':'month_name'}"/>
                        <filter string="date_year" domain="[]" context="{'group_by':'date_year'}"/>

Any help will be greatly appreciated




About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/21/14, 6:55 PM
Seen: 2076 times
Last updated: 3/16/15, 8:10 AM