跳至内容
菜单
此问题已终结
4 回复
34853 查看

Hello,

After i restarted my server, seemed to work but after logging what worked well i saw only this:

https://www.dropbox.com/s/0q13fcipr86tzx9/odoo-bug.PNG?dl=0

I tried to restart odoo,postgresql and other services several times but it didnt work.

Log file:

https://www.dropbox.com/s/dddfqqyxdlz3ogf/odoo-server %281%29.log?dl=0

At the moment i don't know where to put on to get it working

 



形象
丢弃
最佳答案

Seems like an old post that got bumped up. If anyone faces a similar issue, try this.

Log in to odoo with a user who has Administrator privileges. Then type in ?debug=assets at the end of the url and hit enter (use https:// or http:// depending whether you have SSL enabled or not). 

Your url should look like this <your odoo site url:port>/web?debug=assets

This enables developer mode (with assets). Then go to Open Developer Tools (the tiny bug icon at the top right of your screen) and select Regenerate Assets Bundles

This should take care of the problem. I've seen this issue occurring when you move an odoo database from one machine to another.

 

形象
丢弃

Thanks it worked:-)

Great. Please click on the “Check mark” on the post to mark it as correct so that others can also benefit from it.

 

Thanks and regards,

Paresh

 

Sent from Mail for Windows 10

 

From: Talha alam
Sent: Sunday, April 19, 2020 3:45 AM
To: Paresh Wagh
Subject: Re: Blank page after logging in odoo

 

Thanks it worked:-)

Sent by Odoo S.A. using Odoo.

 

I faced the same problem and tried to find a solution for hours. Thank you very much @Paresh!

Thanks Paresh Wagh, you saved my day!

最佳答案

I crossed your question 5 months ago and didn't found the answer until recently. Many reason might cause this error, but here is what caused it for me.


This answer will probably help you if you have custom routes in your controllers.


First of all, the solution :
​​

You should never redefine any attribute of the `Response` object in a direct manner. 
This mean that a line such as

 Response.status = '400 Invalid credentials'

 will cause this error to occur everytime the route in which you have it is called. 

More in-depth about this bug : 

When you do

 Response.status = '400 Bad request' 

you regain control of the Response object, and interrupt the normal workflow of odoo. Therefore, it is no longer able to use it correctly, and every Response returned by any odoo route will have the last status defined until you restart server (in this exemple, 400, so every request is considered as a BadRequest, causing the blank page and diverses others bugs, but 200 would do the same since 302 is necessary for redirections). 

If anybody knows why Odoo doesn't regain control of the Response object, feel free to edit this answer (and please do, this bugged me for so long). 
  

So how to modify the response status? : 

A quick glance at the core modules gives us the answer

Case of custom HTTP method (Like POST) :  ​


raise werkzeug.exception.BadRequest("400 Invalid credentials")


Note that you can't raise any other error than 400 by default. If you want to do so, you have to modify the http.py file in the odoo's root repertory. But be aware that this probably mean you didn't understood the HTTP protocol, as I did. In fact, most of the time you should return 200, there is no HTTP error so request is a success. However you should add a `error` attribute to the json returned if behavior is not what the client expect (like a wrong password at connexion). 

Case of standard method AFAIK (Like GET): 

response = werkzeug.wrappers.Response(json.dumps({<i>[your json dictionary]</i>}), status="400 Invalid credentials")
return response
形象
丢弃
最佳答案

Open inspect in your browser and see in console. if any error then solve it. like missing some abc.js file or etc..

形象
丢弃
最佳答案

Dear Agatino,


i have ever faced a similar problem, respectively similar errors in the log file. The source of the problem was a missing addon-path during the initialization of a new database. The typical error message is "ImportError: No module named fields".

If, having an emtpy database, you start the odoo server without specifying "/odoo/odoo-server/odoo/addons" as an addon-path, you will see this error message in the log file: ""ImportError: No module named fields".

I don't know if it's possible to correct the problem without having to drop the database and create a new one. I would suggest to drop the database, create a new one an start odoo 

$ dropdb rpr1
$ createdb rpr1 


Best regards

Yvan

形象
丢弃