Odoo Help


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.


How to resolve the below Programming Error?

on 6/16/14, 9:51 AM 612 views

Hi to All,

I am new to Openerp i am getting this below error

ProgrammingError: column crm_new_report.id does not exist LINE 1: SELECT "crm_new_report".id FROM "crm_new_report" ORDER... 


My code is :


    def init(self, cr):

            Crm analysis
            @param cr: the current row, from the database cursor
        tools.drop_view_if_exists(cr, 'crm_new_report')
         CREATE OR REPLACE VIEW crm_new_report AS (
                SELECT tick_id, name, create_date, date_closed FROM crm_claim

    def unlink(self, cr, uid, ids, context=None):
        raise osv.except_osv(_('Error!'), _('You cannot delete any record from report section!'))


Any one can Please rectify me, what I did mistake here.


Thanks in Advance.....


On 4/29/15, 6:36 AM

plz could you tell me how do you call the init function? it is called automatically in the initialisation of the model or you call it through another button?
best regards

On 6/16/14, 11:52 AM

Thanks Raphael Collet. It is working fine now, Have a nice day...

Raphael Collet (rco)
On 6/16/14, 10:58 AM

The ORM is trying to access the records in the table 'crm_new_report'. In order to do this, it expects that table to have a column called 'id' (all Odoo models have this). So your view must define a unique 'id' for each row.

In your case, an easy fix is to reuse the id of 'crm_claim':

CREATE OR REPLACE VIEW crm_new_report AS (
                SELECT id, tick_id, name, create_date, date_closed FROM crm_claim

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

1 follower(s)


Asked: 6/16/14, 9:51 AM
Seen: 612 times
Last updated: 4/29/15, 7:27 AM