docker exec -it --user=odoo odoo /bin/bash
cd /usr/bin/
odoo shell -d NAMA_DB -c /etc/odoo/odoo.conf --db_host NAMA_CONTAINER_DB --db_password PASSWORD_DB
domain = [('res_model', '=', 'ir.ui.view'), ('name', 'like', 'assets_')]
env['ir.attachment'].search(domain).unlink()
env.cr.commit()
quit()
-
-
Save arisnew/bfe099b0c5ef42be77d37351b4810172 to your computer and use it in GitHub Desktop.
Hi arisnew,
Thanks for above, As i am beginner can you explain a bit more how can I access the shell so that i could use above commands (right now i am using SSH with putty and after login command above does not work). I am having issue with odoo 17 after restoring web volume. The issue is that i cannot see ip:port/web pages once i log in to odoo. As web cannot be accessed i cannot enable debug mode within the odoo so i can only do it from command shell that i dont know how to reach. I am using SSH (Putty) to access my docker in NAS and i am also using portainer.
In my docker compose yml file i am using the following for the test: db: image: postgres:15 restart: always environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD=myodoo - POSTGRES_USER=odoo - PGDATA=/var/lib/postgresql/data/pgdata ports: - "5434:5432" volumes: - odoo-db-data:/var/lib/postgresql/data
Thank you
hi @Persil090 , from your docker compose yml file not describe odoo service, db service only
Hi arisnew,
Thanks for above, As i am beginner can you explain a bit more how can I access the shell so that i could use above commands (right now i am using SSH with putty and after login command above does not work). I am having issue with odoo 17 after restoring web volume. The issue is that i cannot see ip:port/web pages once i log in to odoo. As web cannot be accessed i cannot enable debug mode within the odoo so i can only do it from command shell that i dont know how to reach.
I am using SSH (Putty) to access my docker in NAS and i am also using portainer.
In my docker compose yml file i am using the following for the test:
db:
image: postgres:15
restart: always
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=myodoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "5434:5432"
volumes:
- odoo-db-data:/var/lib/postgresql/data
Thank you