I am new to odoo development and i was experimenting with the module created by scaffold by adding new fields and menu items, but i get same error all the time. At first i thought it was installation problem, because at first i installed it with apt but now after installing with source i get same error. please help if you have experienced same error or know what is causing it. here is complete error:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/root/odoo/odoo/http.py", line 646, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/root/odoo/odoo/http.py", line 307, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/root/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/root/odoo/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/root/odoo/odoo/http.py", line 339, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/root/odoo/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/root/odoo/odoo/http.py", line 332, in checked_call
result = self.endpoint(*a, **kw)
File "/root/odoo/odoo/http.py", line 927, in __call__
return self.method(*args, **kw)
File "/root/odoo/odoo/http.py", line 512, in response_wrap
response = f(*args, **kw)
File "/root/odoo/addons/web/controllers/main.py", line 924, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/root/odoo/addons/web/controllers/main.py", line 916, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/root/odoo/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/root/odoo/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/root/odoo/odoo/models.py", line 2512, in read
self._read_from_database(stored, inherited)
File "/root/odoo/odoo/models.py", line 2631, in _read_from_database
cr.execute(query_str, params)
File "/root/odoo/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/root/odoo/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError:
column openacademy_openacademy.value3 does not exist LINE 1:
...ademy_openacademy"."description" as "description","openacade...
^
HINT: Perhaps you meant to reference the column "openacademy_openacademy.value" or the column "openacademy_openacademy.value2".
I can't figure out how i deal with that hint please help.
here is modules.py file:
from odoo import models, fields, api
class openacademy(models.Model):
_name = 'openacademy.openacademy'
name = fields.Char()
value = fields.Integer()
value2 = fields.Float(compute="_value_pc", store=True)
description = fields.Text()
value3 = fields.Float(compute="_value_pc", store=True)
@api.depends('value')
def _value_pc(self):
self.value2 = float(self.value) / 100
here is my viewvs.xml file:
<odoo>
<data>
<!-- explicit list view definition -->
<record model="ir.ui.view" id="openacademy.list">
<field name="name">openacademy list</field>
<field name="model">openacademy.openacademy</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="value"/>
<field name="value2"/>
<field name="value3"/>
</tree>
</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="openacademy.action_window">
<field name="name">openacademy window</field>
<field name="res_model">openacademy.openacademy</field>
<field name="view_mode">tree,form</field>
</record>
<!-- server action to the one above -->
<record model="ir.actions.server" id="openacademy.action_server">
<field name="name">openacademy server</field>
<field name="model_id" ref="model_openacademy_openacademy"/>
<field name="state">code</field>
<field name="code">
action = {
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"res_model": self._name,
}
</field>
</record>
<!-- Top menu item -->
<menuitem name="openacademy" id="openacademy.menu_root"/>
<!-- menu categories -->
<menuitem name="Menu 1" id="openacademy.menu_1" parent="openacademy.menu_root"/>
<menuitem name="Menu 2" id="openacademy.menu_2" parent="openacademy.menu_root"/>
<!-- actions -->
<menuitem name="List" id="openacademy.menu_1_list" parent="openacademy.menu_1"
action="openacademy.action_window"/>
<menyitem name="List1" id="openacademy.menu_1_list1" parent="openacademy.menu_1"/>
<menuitem name="Server to list" id="openacademy" parent="openacademy.menu_2"
action="openacademy.action_server"/>
</data>
</odoo>