Skip to content

Commit d14ce4a

Browse files
committed
First POC
1 parent 2697b8e commit d14ce4a

84 files changed

Lines changed: 1047 additions & 435 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Whitespace-only changes.

.gitlab-ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
stages:
2+
- git-robot
3+
- check_repository_structure
4+
- check_python_syntax
5+
6+
git-rebase-branch:
7+
stage: git-robot
8+
script:
9+
- echo 'Has to be improved to autoamtically rebase'
10+
#- git clone git@gitlab.dev.mind-and-go.net:${CI_PROJECT_PATH}.git
11+
#- cd ${CI_PROJECT_NAME}
12+
#- git checkout ts
13+
#- git rebase master
14+
#- git push --force origin ts
15+
16+
check_repository_minimum_files:
17+
stage: check_repository_structure
18+
script:
19+
- echo "Checking minimal repository structure"
20+
- echo 'Is .gitignore file preset and created FROM gitlab.dev.mind-and-go.net and use templates'
21+
- test -e ./.gitignore
22+
- echo 'Is a README.md file present? Precise whats going on there'
23+
- test -e ./README.md
24+
- echo 'Is a requirements.txt file present ? put inside the python libraries dependencies'
25+
- test -e ./requirements.txt
26+
27+
check_modules_structure:
28+
stage: check_repository_structure
29+
script:
30+
- echo "Checking minimal module structure"
31+
32+
pylint:
33+
stage: check_python_syntax
34+
script:
35+
- echo "Running pylint on the project"
36+
- pylint --load-plugins=pylint_odoo -d all -e odoolint ./*

.pre-commit-config.yaml

Lines changed: 56 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,18 @@ exclude: |
55
# Files and folders generated by bots, to avoid loops
66
^setup/|/static/description/index\.html$|
77
# We don't want to mess with tool-generated files
8-
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
99
# Maybe reactivate this when all README files include prettier ignore tags?
1010
^README\.md$|
1111
# Library files can have extraneous formatting (even minimized)
1212
/static/(src/)?lib/|
1313
# Repos using Sphinx to generate docs don't need prettying
1414
^docs/_templates/.*\.html$|
15-
# Don't bother non-technical authors with formatting issues in docs
16-
readme/.*\.(rst|md)$|
17-
# Ignore build and dist directories in addons
18-
/build/|/dist/|
19-
# Ignore test files in addons
20-
/tests/samples/.*|
2115
# You don't usually want a bot to modify your legal texts
2216
(LICENSE.*|COPYING.*)
2317
default_language_version:
2418
python: python3
25-
node: "22.9.0"
19+
node: "14.13.0"
2620
repos:
2721
- repo: local
2822
hooks:
@@ -33,70 +27,49 @@ repos:
3327
entry: found forbidden files; remove them
3428
language: fail
3529
files: "\\.rej$"
36-
- id: en-po-files
37-
name: en.po files cannot exist
38-
entry: found a en.po file
39-
language: fail
40-
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
41-
- repo: https://github.com/sbidoul/whool
42-
rev: v1.2
43-
hooks:
44-
- id: whool-init
45-
- repo: https://github.com/oca/maintainer-tools
46-
rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded
30+
#- repo: https://github.com/oca/maintainer-tools
31+
#rev: ab1d7f6
32+
#hooks:
33+
#update the NOT INSTALLABLE ADDONS section above
34+
#- id: oca-update-pre-commit-excluded-addons
35+
#- id: oca-fix-manifest-website
36+
#args: ["https://github.com/OCA/project"]
37+
- repo: https://github.com/myint/autoflake
38+
rev: v1.4
4739
hooks:
48-
# update the NOT INSTALLABLE ADDONS section above
49-
- id: oca-update-pre-commit-excluded-addons
50-
- id: oca-fix-manifest-website
51-
args: ["https://github.com/OCA/connector-prestashop"]
52-
- id: oca-gen-addon-readme
40+
- id: autoflake
5341
args:
54-
- --addons-dir=.
55-
- --branch=18.0
56-
- --org-name=OCA
57-
- --repo-name=connector-prestashop
58-
- --if-source-changed
59-
- --keep-source-digest
60-
- --convert-fragments-to-markdown
61-
- id: oca-gen-external-dependencies
62-
- repo: https://github.com/OCA/odoo-pre-commit-hooks
63-
rev: v0.0.33
42+
- --expand-star-imports
43+
- --ignore-init-module-imports
44+
- --in-place
45+
- --remove-all-unused-imports
46+
- --remove-duplicate-keys
47+
- --remove-unused-variables
48+
- repo: https://github.com/psf/black
49+
rev: 20.8b1
6450
hooks:
65-
- id: oca-checks-odoo-module
66-
- id: oca-checks-po
67-
args:
68-
- --disable=po-pretty-format
69-
- repo: local
51+
- id: black
52+
- repo: https://github.com/pre-commit/mirrors-prettier
53+
rev: v2.1.2
7054
hooks:
7155
- id: prettier
7256
name: prettier (with plugin-xml)
73-
entry: prettier
57+
additional_dependencies:
58+
- "prettier@2.1.2"
59+
- "@prettier/plugin-xml@0.12.0"
7460
args:
75-
- --write
76-
- --list-different
77-
- --ignore-unknown
78-
types: [text]
61+
- --plugin=@prettier/plugin-xml
7962
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
80-
language: node
81-
additional_dependencies:
82-
- "prettier@3.3.3"
83-
- "@prettier/plugin-xml@3.4.1"
84-
- repo: local
63+
- repo: https://github.com/pre-commit/mirrors-eslint
64+
rev: v7.8.1
8565
hooks:
8666
- id: eslint
87-
name: eslint
88-
entry: eslint
67+
verbose: true
8968
args:
9069
- --color
9170
- --fix
92-
verbose: true
93-
types: [javascript]
94-
language: node
95-
additional_dependencies:
96-
- "eslint@9.12.0"
97-
- "eslint-plugin-jsdoc@50.3.1"
9871
- repo: https://github.com/pre-commit/pre-commit-hooks
99-
rev: v4.6.0
72+
rev: v3.2.0
10073
hooks:
10174
- id: trailing-whitespace
10275
# exclude autogenerated files
@@ -117,21 +90,37 @@ repos:
11790
- id: check-xml
11891
- id: mixed-line-ending
11992
args: ["--fix=lf"]
120-
- repo: https://github.com/astral-sh/ruff-pre-commit
121-
rev: v0.6.8
93+
- repo: https://github.com/asottile/pyupgrade
94+
rev: v2.7.2
95+
hooks:
96+
- id: pyupgrade
97+
args: ["--keep-percent-format"]
98+
- repo: https://github.com/PyCQA/isort
99+
rev: 5.5.1
100+
hooks:
101+
- id: isort
102+
name: isort except __init__.py
103+
args:
104+
- --settings=.
105+
exclude: /__init__\.py$
106+
- repo: https://gitlab.com/pycqa/flake8
107+
rev: 3.9.2
122108
hooks:
123-
- id: ruff
124-
args: [--fix, --exit-non-zero-on-fix]
125-
- id: ruff-format
126-
- repo: https://github.com/OCA/pylint-odoo
127-
rev: v9.1.3
109+
- id: flake8
110+
additional_dependencies: ["flake8-bugbear==21.9.2"]
111+
- repo: https://github.com/PyCQA/pylint
112+
rev: pylint-2.5.3
128113
hooks:
129-
- id: pylint_odoo
114+
- id: pylint
130115
name: pylint with optional checks
131116
args:
132117
- --rcfile=.pylintrc
133118
- --exit-zero
134119
verbose: true
135-
- id: pylint_odoo
120+
additional_dependencies: &pylint_deps
121+
- pylint-odoo==3.5.0
122+
- id: pylint
123+
name: pylint with mandatory checks
136124
args:
137125
- --rcfile=.pylintrc-mandatory
126+
additional_dependencies: *pylint_deps

.pylintrc

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
2-
31
[MASTER]
42
load-plugins=pylint_odoo
53
score=n
64

75
[ODOOLINT]
8-
readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
9-
manifest-required-authors=Odoo Community Association (OCA)
10-
manifest-required-keys=license
11-
manifest-deprecated-keys=description,active
12-
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
13-
valid-odoo-versions=18.0
6+
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
7+
manifest_required_authors=Mind And Go,Mind And Go (M&Go),M&Go
8+
manifest_required_keys=license
9+
manifest_deprecated_keys=description,active
10+
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
11+
valid_odoo_versions=10.0
1412

1513
[MESSAGES CONTROL]
1614
disable=all
@@ -66,39 +64,6 @@ enable=anomalous-backslash-in-string,
6664
use-vim-comment,
6765
wrong-tabs-instead-of-spaces,
6866
xml-syntax-error,
69-
attribute-string-redundant,
70-
character-not-valid-in-resource-link,
71-
consider-merging-classes-inherited,
72-
context-overridden,
73-
create-user-wo-reset-password,
74-
dangerous-filter-wo-user,
75-
dangerous-qweb-replace-wo-priority,
76-
deprecated-data-xml-node,
77-
deprecated-openerp-xml-node,
78-
duplicate-po-message-definition,
79-
except-pass,
80-
file-not-used,
81-
invalid-commit,
82-
manifest-maintainers-list,
83-
missing-newline-extrafiles,
84-
missing-readme,
85-
missing-return,
86-
odoo-addons-relative-import,
87-
old-api7-method-defined,
88-
po-msgstr-variables,
89-
po-syntax-error,
90-
renamed-field-parameter,
91-
resource-not-exist,
92-
str-format-used,
93-
test-folder-imported,
94-
translation-contains-variable,
95-
translation-positional-used,
96-
unnecessary-utf8-coding-comment,
97-
website-manifest-key-not-valid-uri,
98-
xml-attribute-translatable,
99-
xml-deprecated-qweb-directive,
100-
xml-deprecated-tree-attribute,
101-
external-request-timeout,
10267
# messages that do not cause the lint step to fail
10368
consider-merging-classes-inherited,
10469
create-user-wo-reset-password,

.pylintrc-mandatory

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
21
[MASTER]
32
load-plugins=pylint_odoo
43
score=n
54

65
[ODOOLINT]
7-
readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
8-
manifest-required-authors=Odoo Community Association (OCA)
9-
manifest-required-keys=license
10-
manifest-deprecated-keys=description,active
11-
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
12-
valid-odoo-versions=18.0
6+
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
7+
manifest_required_authors=Mind And Go,Mind And Go (M&Go),M&Go
8+
manifest_required_keys=license
9+
manifest_deprecated_keys=description,active
10+
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
11+
valid_odoo_versions=10.0
1312

1413
[MESSAGES CONTROL]
1514
disable=all
@@ -57,40 +56,7 @@ enable=anomalous-backslash-in-string,
5756
unreachable,
5857
use-vim-comment,
5958
wrong-tabs-instead-of-spaces,
60-
xml-syntax-error,
61-
attribute-string-redundant,
62-
character-not-valid-in-resource-link,
63-
consider-merging-classes-inherited,
64-
context-overridden,
65-
create-user-wo-reset-password,
66-
dangerous-filter-wo-user,
67-
dangerous-qweb-replace-wo-priority,
68-
deprecated-data-xml-node,
69-
deprecated-openerp-xml-node,
70-
duplicate-po-message-definition,
71-
except-pass,
72-
file-not-used,
73-
invalid-commit,
74-
manifest-maintainers-list,
75-
missing-newline-extrafiles,
76-
missing-readme,
77-
missing-return,
78-
odoo-addons-relative-import,
79-
old-api7-method-defined,
80-
po-msgstr-variables,
81-
po-syntax-error,
82-
renamed-field-parameter,
83-
resource-not-exist,
84-
str-format-used,
85-
test-folder-imported,
86-
translation-contains-variable,
87-
translation-positional-used,
88-
unnecessary-utf8-coding-comment,
89-
website-manifest-key-not-valid-uri,
90-
xml-attribute-translatable,
91-
xml-deprecated-qweb-directive,
92-
xml-deprecated-tree-attribute,
93-
external-request-timeout
59+
xml-syntax-error
9460

9561
[REPORTS]
9662
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}

connector_prestashop/__manifest__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"account",
1313
"base_vat", # for vat validation on partner address
1414
"product_multi_category", # oca/product-attribute
15-
"product_multi_image", # oca/product-attribute
15+
# "product_multi_image", # oca/product-attribute #TODO
1616
"connector_ecommerce", # oca/connector-ecommerce
1717
"purchase",
1818
],
@@ -47,7 +47,8 @@
4747
"views/account_tax_group_views.xml",
4848
"views/prestashop_address_views.xml",
4949
"views/prestashop_backend_views.xml",
50-
"views/connector_prestashop_menu.xml",
50+
"views/prestashop_shop_group_views.xml",
51+
"views/prestashop_shop_views.xml",
5152
"views/prestahop_sale_order_views.xml",
5253
"views/prestashop_account_tax_group_views.xml",
5354
"views/prestashop_delivery_carrier_views.xml",
@@ -58,8 +59,6 @@
5859
"views/prestashop_res_partner_category_views.xml",
5960
"views/prestashop_res_partner_views.xml",
6061
"views/prestashop_sale_order_state_views.xml",
61-
"views/prestashop_shop_group_views.xml",
62-
"views/prestashop_shop_views.xml",
6362
"views/product_category_views.xml",
6463
"views/product_product_views.xml",
6564
"views/product_template_views.xml",
@@ -70,6 +69,7 @@
7069
"views/sale_order_views.xml",
7170
"views/stock_location_views.xml",
7271
"views/stock_warehouse_views.xml",
72+
"views/connector_prestashop_menu.xml",
7373
],
7474
"application": True,
7575
}

connector_prestashop/components/auto_matching_importer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44

55
from odoo import _, exceptions
6-
76
from odoo.addons.component.core import Component
87

98
_logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)