Skip to content

Commit

Permalink
Initialize 15.0 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lmignon committed Nov 25, 2021
1 parent 5433639 commit 1ad3b65
Show file tree
Hide file tree
Showing 52 changed files with 292 additions and 243 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.3.6
_src_path: gh:oca/oca-addons-repo-template
ci: Travis
ci: GitHub
dependency_installation_mode: PIP
generate_requirements_txt: true
include_wkhtmltopdf: false
odoo_version: 14.0
odoo_version: 15.0
rebel_module_groups: []
repo_description: 'TODO: add repo description.'
repo_name: connector
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
# We also need to pin to an older version of python for older odoo versions
# where we are not using black > 21. Older black versions won't work with
# Python 3.9.8+, and we can't bump black without reformatting.
python-version: "3.9.7"
python-version: "3.10"
- uses: pre-commit/[email protected]
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: test Odoo addons

on:
pull_request:
branches:
- "15.0*"
push:
branches:
- "15.0*"

jobs:
test:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.8-ocb15.0:latest
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
36 changes: 21 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^component/|
^component_event/|
^connector/|
^connector_base_product/|
^test_component/|
^test_connector/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
Expand All @@ -16,7 +22,7 @@ exclude: |
(LICENSE.*|COPYING.*)
default_language_version:
python: python3
node: "14.13.0"
node: "14.18.0"
repos:
- repo: local
hooks:
Expand All @@ -28,7 +34,7 @@ repos:
language: fail
files: "\\.rej$"
- repo: https://github.com/oca/maintainer-tools
rev: ab1d7f6
rev: dfba427ba03900b69e0a7f2c65890dc48921d36a
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
Expand All @@ -46,30 +52,30 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.1.2
rev: v2.4.1
hooks:
- id: prettier
name: prettier (with plugin-xml)
additional_dependencies:
- "prettier@2.1.2"
- "@prettier/plugin-xml@0.12.0"
- "prettier@2.4.1"
- "@prettier/plugin-xml@1.1.0"
args:
- --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: v7.8.1
rev: v7.32.0
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.0.1
hooks:
- id: trailing-whitespace
# exclude autogenerated files
Expand All @@ -91,20 +97,20 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.29.0
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.5.1
rev: 5.9.3
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 2.6.0
rev: 3.0.3
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
Expand All @@ -114,13 +120,13 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.3
rev: 3.9.2
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
rev: v2.11.1
hooks:
- id: pylint
name: pylint with optional checks
Expand All @@ -129,7 +135,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- pylint-odoo==5.0.4
- id: pylint
name: pylint with mandatory checks
args:
Expand Down
34 changes: 33 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ manifest_required_authors=Odoo Community Association (OCA)
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=14.0
valid_odoo_versions=15.0

[MESSAGES CONTROL]
disable=all
Expand Down Expand Up @@ -64,6 +64,38 @@ enable=anomalous-backslash-in-string,
use-vim-comment,
wrong-tabs-instead-of-spaces,
xml-syntax-error,
attribute-string-redundant,
character-not-valid-in-resource-link,
consider-merging-classes-inherited,
context-overridden,
create-user-wo-reset-password,
dangerous-filter-wo-user,
dangerous-qweb-replace-wo-priority,
deprecated-data-xml-node,
deprecated-openerp-xml-node,
duplicate-po-message-definition,
except-pass,
file-not-used,
invalid-commit,
manifest-maintainers-list,
missing-newline-extrafiles,
missing-readme,
missing-return,
odoo-addons-relative-import,
old-api7-method-defined,
po-msgstr-variables,
po-syntax-error,
renamed-field-parameter,
resource-not-exist,
str-format-used,
test-folder-imported,
translation-contains-variable,
translation-positional-used,
unnecessary-utf8-coding-comment,
website-manifest-key-not-valid-uri,
xml-attribute-translatable,
xml-deprecated-qweb-directive,
xml-deprecated-tree-attribute,
# messages that do not cause the lint step to fail
consider-merging-classes-inherited,
create-user-wo-reset-password,
Expand Down
36 changes: 34 additions & 2 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ manifest_required_authors=Odoo Community Association (OCA)
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=14.0
valid_odoo_versions=15.0

[MESSAGES CONTROL]
disable=all
Expand Down Expand Up @@ -56,7 +56,39 @@ enable=anomalous-backslash-in-string,
unreachable,
use-vim-comment,
wrong-tabs-instead-of-spaces,
xml-syntax-error
xml-syntax-error,
attribute-string-redundant,
character-not-valid-in-resource-link,
consider-merging-classes-inherited,
context-overridden,
create-user-wo-reset-password,
dangerous-filter-wo-user,
dangerous-qweb-replace-wo-priority,
deprecated-data-xml-node,
deprecated-openerp-xml-node,
duplicate-po-message-definition,
except-pass,
file-not-used,
invalid-commit,
manifest-maintainers-list,
missing-newline-extrafiles,
missing-readme,
missing-return,
odoo-addons-relative-import,
old-api7-method-defined,
po-msgstr-variables,
po-syntax-error,
renamed-field-parameter,
resource-not-exist,
str-format-used,
test-folder-imported,
translation-contains-variable,
translation-positional-used,
unnecessary-utf8-coding-comment,
website-manifest-key-not-valid-uri,
xml-attribute-translatable,
xml-deprecated-qweb-directive,
xml-deprecated-tree-attribute

[REPORTS]
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml → .t2d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cache:
- $HOME/.cache/pre-commit

python:
- "3.6"
- "3.8"

addons:
postgresql: "9.6"
Expand All @@ -26,7 +26,7 @@ jobs:
- TESTS=1 ODOO_REPO="OCA/OCB"
env:
global:
- VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0"
- VERSION="15.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0"
- MQT_DEP=PIP

install:
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/102/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-connector-102)
[![Build Status](https://travis-ci.com/OCA/connector.svg?branch=14.0)](https://travis-ci.com/OCA/connector)
[![codecov](https://codecov.io/gh/OCA/connector/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/connector)
[![Translation Status](https://translation.odoo-community.org/widgets/connector-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/connector-14-0/?utm_source=widget)
[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/102/15.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-connector-102)
[![Build Status](https://travis-ci.com/OCA/connector.svg?branch=15.0)](https://travis-ci.com/OCA/connector)
[![codecov](https://codecov.io/gh/OCA/connector/branch/15.0/graph/badge.svg)](https://codecov.io/gh/OCA/connector)
[![Translation Status](https://translation.odoo-community.org/widgets/connector-15-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/connector-15-0/?utm_source=widget)

<!-- /!\ do not modify above this line -->

Expand All @@ -15,16 +15,16 @@ TODO: add repo description.

[//]: # (addons)

Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[component](component/) | 14.0.1.1.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Add capabilities to register and use decoupled components, as an alternative to model classes
[component_event](component_event/) | 14.0.1.0.2 | | Components Events
[connector](connector/) | 14.0.1.1.0 | | Connector
[connector_base_product](connector_base_product/) | 14.0.1.0.0 | | Connector Base Product
[test_component](test_component/) | 14.0.1.0.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Automated tests for Components, do not install.
[test_connector](test_connector/) | 14.0.1.0.0 | | Automated tests for Connector, do not install.
Unported addons
---------------
addon | version | summary
--- | --- | ---
[component](component/) | 14.0.1.1.0 (unported) | Add capabilities to register and use decoupled components, as an alternative to model classes
[component_event](component_event/) | 14.0.1.0.2 (unported) | Components Events
[connector](connector/) | 14.0.1.1.0 (unported) | Connector
[connector_base_product](connector_base_product/) | 14.0.1.0.0 (unported) | Connector Base Product
[test_component](test_component/) | 14.0.1.0.0 (unported) | Automated tests for Components, do not install.
[test_connector](test_connector/) | 14.0.1.0.0 (unported) | Automated tests for Connector, do not install.

[//]: # (end addons)

Expand Down
2 changes: 1 addition & 1 deletion component/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"cachetools",
]
},
"installable": True,
"installable": False,
"development_status": "Production/Stable",
"maintainers": ["guewen"],
}
10 changes: 5 additions & 5 deletions component/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _get_addon_name(full_name):


class ComponentDatabases(dict):
""" Holds a registry of components for each database """
"""Holds a registry of components for each database"""


class ComponentRegistry(object):
Expand Down Expand Up @@ -718,17 +718,17 @@ def _component_match(cls, work, usage=None, model_name=None, **kw):

@property
def collection(self):
""" Collection we are working with """
"""Collection we are working with"""
return self.work.collection

@property
def env(self):
""" Current Odoo environment, the one of the collection record """
"""Current Odoo environment, the one of the collection record"""
return self.work.env

@property
def model(self):
""" The model instance we are working with """
"""The model instance we are working with"""
return self.work.model

def component_by_name(self, name, model_name=None):
Expand Down Expand Up @@ -889,7 +889,7 @@ def _build_component(cls, registry):

@classmethod
def _build_component_check_base(cls, extend_cls):
""" Check whether ``cls`` can be extended with ``extend_cls``. """
"""Check whether ``cls`` can be extended with ``extend_cls``."""
if cls._abstract and not extend_cls._abstract:
msg = (
"%s transforms the abstract component %r into a "
Expand Down
Loading

0 comments on commit 1ad3b65

Please sign in to comment.