Skip to Content
Menu
This question has been flagged
3143 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)""")


Avatar
Discard
Related Posts Replies Views Activity
3
Dec 22
9945
5
Apr 24
39339
6
Apr 24
36743
3
Mar 24
9215
2
Jul 19
765