This question has been flagged
4 Replies
34143 Views

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
Author 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 

Avatar
Discard

this works for me, thank you man :)

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

Thanks a lot!

Perfect, I'm creating my first module and that is basic, but I did not know that

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.

Avatar
Discard

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

OMG, me too !!!

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