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

How fix problem openerp.sql_db ?

By
heru
on 1/28/15, 10:43 AM 949 views

Hello,

i will add search in form 'Sales Analysis' . I add search by group 'Jenis Transaksi' .

i make file in .py :

class sales_analysis(osv.osv):
    _inherit = "sale.report"
    
    _columns = {
                 'jenis': fields.char( 'Jenis Transaksi'),
                }
    
sales_analysis()

 

i make file in .xml :

<record id="sale_report_search_form_view" model="ir.ui.view">
             <field name="name">sale.report.search</field>
             <field name="model">sale.report</field>
             <field name="inherit_id" ref="sale.view_order_product_search"/>    
             <field name="arch" type="xml">                  
                 <xpath expr="//group/filter[@string='Salesperson']" position="after">
                    <filter string="Jenis Transaksi" context="{'group_by':'jenis'}"/>
                </xpath>
             </field>                  
 </record>

when i compile, the result :

2015-01-28 14:37:49,415 11227 ERROR century21-new openerp.sql_db: Programming error: column sale_report.jenis does not exist
LINE 3:                    , "sale_report"."jenis" as jenis ,sum("sa...
                             ^
, in query 
            SELECT min(sale_report.id) AS id, count(sale_report.id) AS __count
                   , "sale_report"."jenis" as jenis ,sum("sale_report"."nbr") AS nbr,sum("sale_report"."product_uom_qty") AS product_uom_qty,sum("sale_report"."shipped_qty_1") AS shipped_qty_1,sum("sale_report"."price_total") AS price_total,sum("sale_report"."delay") AS delay
            FROM "sale_report"
            
            GROUP BY "sale_report"."jenis"
            ORDER BY jenis
            
            
        
2015-01-28 14:37:49,415 11227 ERROR century21-new openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/orm.py", line 2778, in read_group
    cr.execute(query, where_clause_params)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: column sale_report.jenis does not exist
LINE 3:                    , "sale_report"."jenis" as jenis ,sum("sa...
                             ^

2015-01-28 14:37:49,459 11227 ERROR century21-new openerp.netsvc: column sale_report.jenis does not exist
LINE 3:                    , "sale_report"."jenis" as jenis ,sum("sa...
                             ^
Traceback (most recent call last):
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/service/web_services.py", line 632, in dispatch
    res = fn(db, uid, *params)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/orm.py", line 2778, in read_group
    cr.execute(query, where_clause_params)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: column sale_report.jenis does not exist
LINE 3:                    , "sale_report"."jenis" as jenis ,sum("sa...
                             ^

how fix my problem ?

 

thanks.

0
Daniel Mattos
On 12/22/15, 12:33 AM

if add column 'jenis' should drop view sale_report from postgres query

drop view sale_report

and update module sale.


0

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 1/29/15, 4:43 AM

In your query SELECT min(sale_report.id) AS id, ....  , try without Quotation Marks ("  "):  ... sale_report.jenis as jenis ...

please explain me Sir, how to edit in my query ? thanks

heru
on 1/30/15, 1:23 AM

Delete the quotations mark arround sale_report and jenis: Change "sale_report"."jenis" as jenis to sale_report.jenis as jenis

Med Said BARA
on 1/30/15, 8:13 AM

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

2 follower(s)

Stats

Asked: 1/28/15, 10:43 AM
Seen: 949 times
Last updated: 12/22/15, 12:33 AM