Skip to Content
Menu
This question has been flagged
4 Replies
3835 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.

Avatar
Discard
Best Answer

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

drop view sale_report

and update module sale.


Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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

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