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

ProgrammingError: column bom_report.id does not exist

By
Ranga Dharmapriya
on 6/1/15, 12:30 AM 493 views

I'm try to create a bom report,But  when I run my code I got this error...


Odoo Server Error

Traceback (most recent call last):

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "D:\Odoo\odoo-v8-osm\openerp\service\model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 796, in __call__

return self.method(*args, **kw)

File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 396, in response_wrap

response = f(*args, **kw)

File "D:\Odoo\odoo-v8-osm\addons\web\controllers\main.py", line 935, in call_kw

return self._call_kw(model, method, args, kwargs)

File "D:\Odoo\odoo-v8-osm\addons\web\controllers\main.py", line 927, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "D:\Odoo\odoo-v8-osm\openerp\api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "D:\Odoo\odoo-v8-osm\openerp\models.py", line 2137, in read_group

cr.execute(query, where_clause_params)

File "D:\Odoo\odoo-v8-osm\openerp\sql_db.py", line 158, in wrapper

return f(self, *args, **kwargs)

File "D:\Odoo\odoo-v8-osm\openerp\sql_db.py", line 234, in execute

res = self._obj.execute(query, params)

ProgrammingError: column bom_report.id does not exist

LINE 2: SELECT min(bom_report.id) AS id, count(bom_repor...


Anyone know how to solve this?

Thank You

 class bom_report(osv.osv):
    _name = 'bom.report'
    _description = 'BOM Report'
    _auto = False
    _log_access = False
    _columns = {
        'bom_id': fields.integer('BOM', readonly=True),
        'product_id': fields.many2one('product.product', 'Product'),
        'product_qty': fields.integer('Product Quantity', readonly=True),
    }

    def init(self, cr):
        cr.execute("""
                    CREATE or REPLACE VIEW bom_report AS(
                    SELECT
                        s.bom_id,
                        s.product_id,
                        s.product_qty
                    FROM
                        mrp_bom_line s
                    LEFT JOIN mrp_bom p
                    ON p.id = s.bom_id)""")


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)

Stats

Asked: 6/1/15, 12:30 AM
Seen: 493 times
Last updated: 6/1/15, 1:40 AM