Help

0

Weird Error: ProgrammingError: relation "_unknown" does not exist LINE 1: SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id...

Avatar
Abdullah Sofan

When I make many2one field to one of the base modules (like, account.invoice or hr.employee), sometimes it works fine but other times I get this weird Error:

 

ProgrammingError: relation "_unknown" does not exist LINE 1: SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id...

This only gets resolved when I completely restart the system (the windows machine). Does anyone know what could be leading to this?

Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 518, in _handle_exception File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 539, in dispatch File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 295, in _call_function File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\service\model.py", line 113, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 292, in checked_call File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 755, in __call__ File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\http.py", line 388, in response_wrap File "C:\Program Files (x86)\Odoo 8.0-20141221\server\openerp\addons\web\controllers\main.py", line 949, in call_kw File "C:\Program Files (x86)\Odoo 8.0-20141221\server\openerp\addons\web\controllers\main.py", line 941, in _call_kw File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\api.py", line 237, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\api.py", line 332, in old_api File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\models.py", line 1734, in name_search File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\api.py", line 235, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\api.py", line 464, in new_api File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\models.py", line 1746, in _name_search File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\api.py", line 237, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\models.py", line 4587, in _search File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\sql_db.py", line 158, in wrapper File "C:\Program Files (x86)\Odoo 8.0-20141221\server\.\openerp\sql_db.py", line 234, in execute ProgrammingError: relation "_unknown" does not exist LINE 1: SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id...

Avatar
Discard
4 Answers
2
Avatar
Abdullah Sofan
Best Answer

After digging a little deeper into this problem, it seems only to happen when I use the "Upgrade" button to updgrade my module.

The way to resolve it is by restarting both the "Odoo" service and also the "postgres" service 

1 Comment
Avatar
Discard
Avatar
Tri Nanda
-

this works for me, thank you man :)

6
Best Answer

Hi,

this post may be a bit old, but was struggling in same issue for few... hours.

In my case, it was a 'small' typo in the Many2one reference object.


Hope this may save some time to others in same situations.

3 Comments
Avatar
Discard
Avatar
Jérôme Thériault
-

!!! Same here! res.user instead of the plural res.users! What a cryptic error :'(

Avatar
Mai Pham
-

OMG, me too !!!

Avatar
Fazle Rabbi Ferdaus
-

Same here

5
Avatar
Denis Roussel
Best Answer

Abdullah,

Please look at your dependencies in your __openerp__.py.

I've just have the problem : I forgot to mention the depending modules for every relation I have in my own module

Hope this helps

Avatar
Discard
2
Avatar
Aristóbulo Meneses
Best Answer

This problem occurs when you declare a Many2one field passing arguments in the wrong order to the constructor.

For example:

account_id = fields.Many2one('Account', 'account.account', required=True)  [WRONG]

instead of:

account_id = fields.Many2one('account.account''Account', required=True) [CORRECT]

You don't get an exception, but relation is not properly created.

Avatar
Discard