Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have moved Odoo Server and Database to another machine. Why can't I load my CSS?

I deployed odoo 10 CE on my local Ubuntu server 16.04 LTS with nginx reverse proxy. Now i installed Ubuntu 16.04, Odoo 10 CE with nginx as reverse proxy on another server. I restored the database from old server to new server.

If i access my new server like http://x.x.x.x:8069 , it works fine.

But access like http://x.x.x.x , the login page shows with out css styling. After login can't see any menus, company logo only.

enter image description here

If i try with Private browsing it works fine.

How can i resolve this.

EDIT

I ran the odoo server in two ways, first ran directly from the terminal like :

` sudo su - odoo -s /bin/bash

/odoo/odoo-server/./odoo-bin`

then i access like <ip_address>:8069, it works fine.

But when i try to run as demon ( sudo /etc/init.d/odoo-server start) , i face the same problem.

My system user is: odooadmin

odoo user is : odoo

And if i access via debug mode with assets it woks fine.

 <ip_address>:8069/web?debug=assets

Any solution?

like image 298
KbiR Avatar asked Sep 06 '25 03:09

KbiR


2 Answers

If you moved to another machine there might be issue with loading some assets cached at the level of odoo server, such as transpiled js code for instance.

In order to solve this issue, you should (after restoring the database) connect to your database and run the following command :

DELETE FROM ir_attachment WHERE url LIKE '/web/content/%';.

More information here : https://github.com/odoo/odoo/issues/13808

like image 172
efx Avatar answered Sep 07 '25 21:09

efx


Sometimes you can get an Internal Server Error 500. In other cases you can get what you got. There are a few things you can try:

  1. Remove Browser Cache. You can press Shift + Ctrl + Supr. Or reload without cache with Ctrl + F5
  2. Remove Cookies. If you are using chrome or chromium you can delete the cookies stored for the domain you are using as you can see in the images:

cookies removal

  1. web.base.url Parameter. Activate deleloper mode. Go to Settings > Parameters > System Parameters and check that the parameter web.base.url is correctly set. This parameter is updated each time you log in with the Administrator user, the value of the url bar is assigned to the parameter. But if you can get it to work with the private mode I assume this is well assigned.
like image 44
ChesuCR Avatar answered Sep 07 '25 21:09

ChesuCR