update
This commit is contained in:
parent
ec35d4ec73
commit
76590cba19
34
setup/Dockerfile
Normal file
34
setup/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
FROM odoo:18.0
|
||||
# Overwrite odoo with addons
|
||||
COPY ./odoo /usr/lib/python3/dist-packages/
|
||||
COPY ./addons /usr/lib/python3/dist-packages/odoo
|
||||
COPY ./deployment/entrypoint.sh /
|
||||
# Copy entrypoint script and Odoo configuration file
|
||||
# COPY deployment/entrypoint.sh /
|
||||
# COPY deployment/odoo.conf /etc/odoo/
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y libreoffice
|
||||
USER odoo
|
||||
COPY ./deployment/requirements.txt /usr/lib/python3/dist-packages/odoo
|
||||
RUN pip install -r /usr/lib/python3/dist-packages/odoo/requirements.txt --break-system-packages
|
||||
# Set permissions and Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons and /mnt/backup for backup
|
||||
RUN chown odoo /etc/odoo/odoo.conf \
|
||||
&& mkdir -p /mnt/extra-addons \
|
||||
&& chown -R odoo /mnt/extra-addons \
|
||||
&& mkdir -p /var/lib/odoo/backup \
|
||||
&& chown -R odoo /var/lib/odoo/backup
|
||||
VOLUME ["/var/lib/odoo", "/mnt/extra-addons","/var/lib/odoo/backup"]
|
||||
|
||||
# Expose Odoo services
|
||||
EXPOSE 8069 8071 8072
|
||||
|
||||
# Set the default config file
|
||||
ENV ODOO_RC /etc/odoo/odoo.conf
|
||||
|
||||
# COPY deployment/wait-for-psql.py /usr/local/bin/wait-for-psql.py
|
||||
|
||||
# Set default user when running the container
|
||||
USER odoo
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["odoo"]
|
12
setup/get_table.py
Normal file
12
setup/get_table.py
Normal file
@ -0,0 +1,12 @@
|
||||
import odoorpc
|
||||
|
||||
# Connect to Odoo server
|
||||
odoo = odoorpc.ODOO("workspace.local", port=8069)
|
||||
odoo.login("ambio", "admin", "admin")
|
||||
|
||||
# Query ir.model to get all model names (tables)
|
||||
models = odoo.env["ir.model"].search_read([], ["model"])
|
||||
|
||||
# Extract and print model names (table names)
|
||||
table_names = [model["model"] for model in models]
|
||||
print(table_names)
|
Loading…
Reference in New Issue
Block a user