Skip to content

Commit

Permalink
[IMP] Init for Odoo 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
max3903 committed Feb 24, 2024
1 parent 7799693 commit 8b02efa
Show file tree
Hide file tree
Showing 28 changed files with 306 additions and 219 deletions.
26 changes: 15 additions & 11 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.11.0
_commit: v1.20
_src_path: gh:oca/oca-addons-repo-template
additional_ruff_rules: []
ci: GitHub
dependency_installation_mode: PIP
convert_readme_fragments_to_markdown: true
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
github_enable_codecov: true
github_enable_makepot: true
github_enable_stale_action: true
github_enforce_dev_status_compatibility: true
include_wkhtmltopdf: false
odoo_version: 16.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
odoo_test_flavor: Odoo
odoo_version: 17.0
org_name: Open Source Integrators
org_slug: ursais
rebel_module_groups: []
repo_description: 'TODO: add repo description.'
repo_name: field-service
repo_slug: field-service
repo_website: https://github.com/OCA/field-service
travis_apt_packages: []
travis_apt_sources: []
repo_description: Template for an Odoo Project
repo_name: Template for Odoo Project
repo_slug: odoo-template
repo_website: https://github.com/ursais/odoo-template
use_pyproject_toml: true
use_ruff: true

60 changes: 22 additions & 38 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ exclude: |
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
(LICENSE.*|COPYING.*)|
helm/odoo/templates
default_language_version:
python: python3
node: "16.17.0"
Expand All @@ -28,29 +29,28 @@ repos:
language: fail
files: "\\.rej$"
- repo: https://github.com/oca/maintainer-tools
rev: 4cd2b852214dead80822e93e6749b16f2785b2fe
rev: 451de41fa3e8aa81d077c804322d48632eb5ff74
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://github.com/OCA/field-service"]
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
- id: autoflake
args: ["https://github.com/ursais/odoo-template"]
- id: oca-gen-addon-readme
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 22.8.0
- --addons-dir=.
- --branch=17.0
- --org-name=ursais
- --repo-name=odoo-template
- --if-source-changed
- --keep-source-digest
- --convert-fragments-to-markdown
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
- id: black
- id: oca-checks-odoo-module
- id: oca-checks-po
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: prettier (with plugin-xml)
Expand All @@ -61,15 +61,15 @@ repos:
- --plugin=@prettier/plugin-xml
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.24.0
rev: v9.0.0-beta.1
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
Expand All @@ -91,36 +91,20 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.15.1
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.0.3
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
args:
- --output
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/OCA/pylint-odoo
rev: 7.0.2
rev: v9.0.5
hooks:
- id: pylint_odoo
name: pylint with optional checks
Expand Down
12 changes: 6 additions & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ load-plugins=pylint_odoo
score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Open Source Integrators
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid_odoo_versions=16.0
readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest-required-authors=Open Source Integrators
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid-odoo-versions=17.0

[MESSAGES CONTROL]
disable=all
Expand Down
12 changes: 6 additions & 6 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ load-plugins=pylint_odoo
score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Open Source Integrators
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid_odoo_versions=16.0
readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest-required-authors=Open Source Integrators
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid-odoo-versions=17.0

[MESSAGES CONTROL]
disable=all
Expand Down
30 changes: 30 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

target-version = "py310"
fix = true

[lint]
extend-select = [
"B",
"C90",
"E501", # line too long (default 88)
"I", # isort
"UP", # pyupgrade
]
exclude = ["setup/*"]

[format]
exclude = ["setup/*"]

[per-file-ignores]
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
"__manifest__.py" = ["B018"] # useless expression

[isort]
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]

[isort.sections]
"odoo" = ["odoo"]
"odoo-addons" = ["odoo.addons"]

[mccabe]
max-complexity = 16
72 changes: 36 additions & 36 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
# Install Odoo dependencies

* libffi-dev
* libgeoip-dev
* libjpeg-dev
* libldap2-dev
* libsasl2-dev
* libxml2-dev
* libxslt1-dev
* nginx
* node-less
* postfix
* postgresql
* postgresql-server-dev-9.5
* python-dev
* python-pip
* python-psycopg2
* python-virtualenv
* zlib1g-dev
- libffi-dev
- libgeoip-dev
- libjpeg-dev
- libldap2-dev
- libsasl2-dev
- libxml2-dev
- libxslt1-dev
- nginx
- node-less
- postfix
- postgresql
- postgresql-server-dev-9.5
- python-dev
- python-pip
- python-psycopg2
- python-virtualenv
- zlib1g-dev

# Webkit

* Download Webkit from https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.1
* Install Webkit and create a symlink:
- Download Webkit from https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.1
- Install Webkit and create a symlink:

`# ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf`

# PostgreSQL

* Create a PostgreSQL user for odoo
- Create a PostgreSQL user for odoo

# Odoo

* Create an Odoo user
* Clone the repository
* Change the ownership of the repo to odoo
* Create the environment
- Create an Odoo user
- Clone the repository
- Change the ownership of the repo to odoo
- Create the environment

`$ virtualenv env && . env/bin/activate && pip install -r requirements.txt`

* Create /etc/odoo
* Create Odoo config file
* Create Odoo init script
* Create /var/log/odoo
* Create /var/backups/odoo
* Enable and start Odoo
- Create /etc/odoo
- Create Odoo config file
- Create Odoo init script
- Create /var/log/odoo
- Create /var/backups/odoo
- Enable and start Odoo

# Nginx

* Create Nginx config file
* Create the SSL directory /etc/nginx/ssl
* Generate the SSL certificate
- Create Nginx config file
- Create the SSL directory /etc/nginx/ssl
- Generate the SSL certificate

```
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
Expand All @@ -58,6 +58,6 @@
-out /etc/nginx/ssl/odoo.crt
```

* Change the permission of the certificate file
* Enable new odoo virtual host
* Enable and start Nginx
- Change the permission of the certificate file
- Enable new odoo virtual host
- Enable and start Nginx
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Odoo 16.0 Template Project
# Template for an Odoo 17 Project

## Table of Contents
* [Prerequisites](#Prerequisites)
Expand Down
17 changes: 9 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: "2"
services:
db:
image: ursa/postgresql:latest
Expand All @@ -9,16 +9,16 @@ services:
- POSTGRES_PASSWORD=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- 'postgres-data:/var/lib/postgresql/data'
- "postgres-data:/var/lib/postgresql/data"

odoo:
app:
build:
context: odoo
ports:
- '8069:8069'
- '8072:8072'
- "8069:8069"
- "8072:8072"
volumes:
- 'odoo-data:/odoo/data'
- "odoo-data:/odoo/data"
depends_on:
- db
environment:
Expand All @@ -35,10 +35,11 @@ services:
- ODOO_ADMIN_USER_PASSWORD=admin
- ODOO_DBFILTER=False
- ODOO_LIST_DB=True
- ODOO_SERVER_WIDE_MODULES=web
stdin_open: true
tty: true
# cap_add:
# - sys_ptrace
# cap_add:
# - sys_ptrace

mail:
image: mailhog/mailhog
Expand Down
Loading

0 comments on commit 8b02efa

Please sign in to comment.