2024 m. vasario 14 d., trečiadienis

Odoo17 notes

Odoo


Ctr + K  -    
Search in Odoo

How to install odoo:

https://tecadmin.net/how-to-install-odoo-17-on-ubuntu/
 

Odoo linux package 

sudo apt install odoo

https://nightly.odoo.com/17.0/nightly/deb/

Add-ons location:

 
/usr/lib/python3/dist-packages/odoo/addons/

Filestore location:

$ sudo ls -la /var/lib/odoo/.local/share/Odoo
drwx------ 3 odoo odoo  addons
drwxr-xr-x 3 odoo odoo  filestore
drwx------ 5 odoo odoo sessions

$ cat /etc/passwd | grep odoo
odoo:x:111:122::/var/lib/odoo:/usr/sbin/nologin

Changing file ownership:

sudo chown -R odoo:odoo /data


Installing Odoo-pdf
------
Depends on libssl1.1 but it is not installable

echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list

sudo apt-get update
sudo apt-get install libssl1.1


dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

apt --fix-broken install



Connecting to posgress:

sudo -u postgres psql # Running command as user
sudo su - postgres     # Changing user


\l - list of databases
\du - list of users

how to change postgress password:
ALTER USER "postgres" WITH PASSWORD 'newpass';

pg_hba file:

sudo nano /etc/postgresql/16/main/pg_hba.conf


How to fix Error:

psycopg2.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "odoo"

 This error occurs when the PostgreSQL database is unable to establish a connection with the Odoo user due to incorrect or missing authentication configurations. To resolve this issue, follow these steps:

1. Open the `pg_hba.conf` file in a text editor using sudo privileges:

```bash
sudo nano /etc/postgresql/{your-version}/main/pg_hba.conf
```

Replace `{your-version}` with your installed PostgreSQL version (e.g., 13).

2. Locate the following line, which should be near the end of the file:

```sql
local   all             postgres                                peer
```

Add an entry similar to the one above but for the odoo user and specify trust as the method:

```sql
# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   all             odoo              md5
host    all             odoo          0.0.0.0/0               md5
host    all             odoo          ::/0                     md5
```

This configuration allows connections from any address (IPv4 & IPv6) and enforces password-based MD5 encryption. Save and close the file after editing.

3. Restart the PostgreSQL service to apply changes:

```bash
sudo systemctl restart postgresql
```

4. Now you need to set a secure password for the 'odoo' user. Access the PostgreSQL shell by running:

```bash
sudo -u postgres psql
```

5. Execute the following command inside the PostgreSQL shell to change the password for the odoo user:

```sql
\password odoo
```

Enter a new strong password twice when prompted. Then exit the PostgreSQL shell by typing:

```
\q
```

6. Update your Odoo configuration file with the correct credentials. Edit the `odoo.conf` file located at `/etc/odoo/` or `/etc/odoo-server.conf`, depending upon your installation:

```bash
sudo nano /etc/odoo/odoo.conf
```

7. Ensure that the following lines are present in the configuration file with the appropriate values replaced:

```ini
[options]
...
db_user = odoo
db_password = <new_password>
```

Save and close the file.

8. Finally, restart the Odoo service so it can connect with the updated settings:

sudo systemctl restart odoo

or
```bash
sudo systemctl restart odoo-server
```

Now try accessing Odoo again; it should successfully connect to the PostgreSQL database using the provided credentials.



Owl

https://odoo.github.io/owl/playground/