From 08752350a8757242aaede600cd470bcfdd54cdd4 Mon Sep 17 00:00:00 2001 From: HviorForgeFlow Date: Fri, 29 May 2020 12:27:01 +0200 Subject: [PATCH] [IMP] Update pre-commit lints according with OCA ones --- .editorconfig | 4 +- .eslintrc | 291 ------- .eslintrc.yml | 282 +++++++ .isort.cfg | 2 +- .pre-commit-config.yaml | 164 ++-- .travis.yml | 8 +- rma/data/rma_operation.xml | 22 +- rma/data/rma_sequence.xml | 24 +- rma/data/stock_data.xml | 195 ++--- rma/demo/stock_demo.xml | 95 +-- rma/report/rma_report.xml | 2 +- rma/report/rma_report_templates.xml | 189 +++-- rma/security/rma.xml | 82 +- rma/views/product_view.xml | 53 +- rma/views/res_config_settings_views.xml | 23 +- rma/views/res_partner_view.xml | 23 +- rma/views/rma_menu.xml | 113 ++- rma/views/rma_operation_view.xml | 78 +- rma/views/rma_order_line_view.xml | 709 ++++++++++++------ rma/views/rma_order_view.xml | 367 +++++---- rma/views/stock_view.xml | 13 +- rma/views/stock_warehouse.xml | 21 +- rma/wizards/rma_add_stock_move_view.xml | 155 ++-- rma/wizards/rma_make_picking_view.xml | 115 +-- .../rma_order_line_make_supplier_rma_view.xml | 83 +- rma_account/data/rma_operation.xml | 10 +- rma_account/views/account_move_view.xml | 61 +- rma_account/views/rma_account_menu.xml | 43 +- rma_account/views/rma_operation_view.xml | 10 +- rma_account/views/rma_order_line_view.xml | 126 ++-- rma_account/views/rma_order_view.xml | 84 ++- rma_account/wizards/rma_add_account_move.xml | 158 ++-- rma_account/wizards/rma_refund.xml | 69 +- rma_sale/data/rma_operation.xml | 10 +- rma_sale/views/rma_operation_view.xml | 10 +- rma_sale/views/rma_order_line_view.xml | 109 ++- rma_sale/views/rma_order_view.xml | 22 +- rma_sale/views/sale_order_view.xml | 44 +- rma_sale/wizards/rma_add_sale.xml | 94 ++- .../rma_order_line_make_sale_order_view.xml | 67 +- setup/.setuptools-odoo-make-default-ignore | 2 + setup/README | 2 + setup/rma/odoo/addons/rma | 1 + setup/rma/setup.py | 6 + setup/rma_account/odoo/addons/rma_account | 1 + setup/rma_account/setup.py | 6 + setup/rma_sale/odoo/addons/rma_sale | 1 + setup/rma_sale/setup.py | 6 + 48 files changed, 2477 insertions(+), 1578 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.yml create mode 100644 setup/.setuptools-odoo-make-default-ignore create mode 100644 setup/README create mode 120000 setup/rma/odoo/addons/rma create mode 100644 setup/rma/setup.py create mode 120000 setup/rma_account/odoo/addons/rma_account create mode 100644 setup/rma_account/setup.py create mode 120000 setup/rma_sale/odoo/addons/rma_sale create mode 100644 setup/rma_sale/setup.py diff --git a/.editorconfig b/.editorconfig index 62276b0d..bfd7ac53 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,11 +7,11 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[.eslintrc,*.{json,yml,yaml,rst,md}] +[*.{json,yml,yaml,rst,md}] indent_size = 2 # Do not configure editor for libs and autogenerated content -[*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst] +[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}] charset = unset end_of_line = unset indent_size = unset diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 28a0808b..00000000 --- a/.eslintrc +++ /dev/null @@ -1,291 +0,0 @@ -{ - "globals": { - "$": false, - "_": false, - "fuzzy": false, - "jQuery": false, - "moment": false, - "odoo": false, - "openerp": false, - "self": false - }, - "env": { - "browser": true - }, - "rules": { - "no-alert": "warn", - "no-array-constructor": "warn", - "no-bitwise": "off", - "no-caller": "warn", - "no-case-declarations": "warn", - "no-catch-shadow": "warn", - "no-class-assign": "warn", - "no-cond-assign": "warn", - "no-confusing-arrow": "warn", - "no-console": "off", - "no-const-assign": "warn", - "no-constant-condition": "warn", - "no-continue": "off", - "no-control-regex": "warn", - "no-debugger": "warn", - "no-delete-var": "warn", - "no-div-regex": "warn", - "no-dupe-args": "warn", - "no-dupe-class-members": "warn", - "no-dupe-keys": "warn", - "no-duplicate-case": "warn", - "no-duplicate-imports": "warn", - "no-else-return": "warn", - "no-empty": "warn", - "no-empty-character-class": "warn", - "no-empty-function": "warn", - "no-empty-pattern": "warn", - "no-eq-null": "warn", - "no-eval": "warn", - "no-ex-assign": "warn", - "no-extend-native": "warn", - "no-extra-bind": "warn", - "no-extra-boolean-cast": "warn", - "no-extra-label": "warn", - "no-extra-parens": "warn", - "no-extra-semi": "warn", - "no-fallthrough": "warn", - "no-floating-decimal": "warn", - "no-func-assign": "warn", - "no-implicit-coercion": ["warn", { - "allow": ["~"] - }], - "no-implicit-globals": "warn", - "no-implied-eval": "warn", - "no-inline-comments": "warn", - "no-inner-declarations": "warn", - "no-invalid-regexp": "warn", - "no-invalid-this": "off", - "no-irregular-whitespace": "warn", - "no-iterator": "warn", - "no-label-var": "warn", - "no-labels": "warn", - "no-lone-blocks": "warn", - "no-lonely-if": "warn", - "no-loop-func": "off", - "no-magic-numbers": "off", - "no-mixed-operators": "warn", - "no-mixed-requires": "warn", - "no-mixed-spaces-and-tabs": "warn", - "no-multi-spaces": "warn", - "no-multi-str": "warn", - "no-multiple-empty-lines": "warn", - "no-native-reassign": "warn", - "no-negated-condition": "warn", - "no-negated-in-lhs": "warn", - "no-nested-ternary": "off", - "no-new": "warn", - "no-new-func": "warn", - "no-new-object": "warn", - "no-new-require": "warn", - "no-new-symbol": "warn", - "no-new-wrappers": "warn", - "no-obj-calls": "warn", - "no-octal": "warn", - "no-octal-escape": "warn", - "no-param-reassign": "warn", - "no-path-concat": "warn", - "no-plusplus": "off", - "no-process-env": "warn", - "no-process-exit": "warn", - "no-proto": "warn", - "no-prototype-builtins": "warn", - "no-redeclare": "warn", - "no-regex-spaces": "warn", - "no-restricted-globals": "warn", - "no-restricted-imports": "warn", - "no-restricted-modules": "warn", - "no-restricted-syntax": "warn", - "no-return-assign": "warn", - "no-script-url": "warn", - "no-self-assign": "warn", - "no-self-compare": "warn", - "no-sequences": "warn", - "no-shadow": "warn", - "no-shadow-restricted-names": "warn", - "no-whitespace-before-property": "warn", - "no-spaced-func": "warn", - "no-sparse-arrays": "warn", - "no-sync": "warn", - "no-tabs": "warn", - "no-ternary": "off", - "no-trailing-spaces": "warn", - "no-this-before-super": "warn", - "no-throw-literal": "warn", - "no-undef": "warn", - "no-undef-init": "warn", - "no-undefined": "off", - "no-unexpected-multiline": "warn", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "warn", - "no-unneeded-ternary": "warn", - "no-unreachable": "warn", - "no-unsafe-finally": "warn", - "no-unused-expressions": "warn", - "no-unused-labels": "warn", - "no-unused-vars": "warn", - "no-use-before-define": "warn", - "no-useless-call": "warn", - "no-useless-computed-key": "warn", - "no-useless-concat": "warn", - "no-useless-constructor": "warn", - "no-useless-escape": "warn", - "no-useless-rename": "warn", - "no-void": "warn", - "no-var": "off", - "no-warning-comments": "off", - "no-with": "warn", - "array-bracket-spacing": "off", - "array-callback-return": "warn", - "arrow-body-style": "warn", - "arrow-parens": "warn", - "arrow-spacing": "off", - "accessor-pairs": "warn", - "block-scoped-var": "off", - "block-spacing": ["warn", "always"], - "brace-style": "warn", - "callback-return": "warn", - "camelcase": "off", - "capitalized-comments": ["warn", "always", { - "ignoreConsecutiveComments": true, - "ignoreInlineComments": true - }], - "comma-dangle": ["warn", "always-multiline"], - "comma-spacing": ["warn", { - "before": false, - "after": true - }], - "comma-style": "warn", - "complexity": [ - "warn", - 15 - ], - "computed-property-spacing": "off", - "consistent-return": "off", - "consistent-this": "off", - "constructor-super": "warn", - "curly": "warn", - "default-case": "off", - "dot-location": ["warn", "property"], - "dot-notation": "warn", - "eol-last": "warn", - "eqeqeq": "warn", - "func-names": "off", - "func-style": "off", - "generator-star-spacing": "off", - "global-require": "warn", - "guard-for-in": "off", - "handle-callback-err": "warn", - "id-blacklist": "warn", - "id-length": "off", - "id-match": "warn", - "indent": "warn", - "init-declarations": "warn", - "jsx-quotes": "warn", - "key-spacing": "off", - "keyword-spacing": "warn", - "linebreak-style": [ - "warn", - "unix" - ], - "lines-around-comment": "warn", - "max-depth": "warn", - "max-len": ["warn", { - "code": 88, - "ignorePattern": "odoo\\.define\\(", - "tabWidth": 4 - }], - "max-lines": "off", - "max-nested-callbacks": "warn", - "max-params": "off", - "max-statements": "off", - "max-statements-per-line": "warn", - "multiline-ternary": "off", - "new-cap": "off", - "new-parens": "warn", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "object-curly-newline": ["warn", { "consistent": true }], - "object-curly-spacing": ["warn", "never"], - "object-property-newline": ["warn", { - "allowAllPropertiesOnSameLine": true - }], - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "off", - "operator-assignment": "warn", - "operator-linebreak": "warn", - "padded-blocks": "off", - "prefer-arrow-callback": "off", - "prefer-const": "warn", - "prefer-reflect": "off", - "prefer-rest-params": "off", - "prefer-spread": "off", - "prefer-template": "off", - "quote-props": "off", - "quotes": "off", - "radix": "warn", - "require-yield": "warn", - "rest-spread-spacing": "off", - "semi": [ - "warn", - "always" - ], - "semi-spacing": "warn", - "sort-imports": "warn", - "sort-vars": "off", - "space-before-blocks": "warn", - "space-before-function-paren": "warn", - "space-in-parens": "off", - "space-infix-ops": "off", - "space-unary-ops": "off", - "spaced-comment": ["warn", "always"], - "strict": ["warn", "function"], - "template-curly-spacing": "off", - "unicode-bom": "warn", - "use-isnan": "warn", - "valid-jsdoc": ["warn", { - "prefer": { - "arg": "param", - "argument": "param", - "augments": "extends", - "constructor": "class", - "exception": "throws", - "func": "function", - "method": "function", - "prop": "property", - "return": "returns", - "virtual": "abstract", - "yield": "yields" - }, - "preferType": { - "array": "Array", - "bool": "Boolean", - "boolean": "Boolean", - "number": "Number", - "object": "Object", - "str": "String", - "string": "String" - }, - "requireParamDescription": false, - "requireReturn": false, - "requireReturnDescription": false, - "requireReturnType": false - }], - "valid-typeof": "warn", - "vars-on-top": "off", - "wrap-iife": "warn", - "wrap-regex": "warn", - "yield-star-spacing": "off", - "yoda": "warn" - }, - "parserOptions": { - "ecmaVersion": 2017 - } -} diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..db7d6359 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,282 @@ +{ + "globals": + { + "$": false, + "_": false, + "fuzzy": false, + "jQuery": false, + "moment": false, + "odoo": false, + "openerp": false, + "self": false, + }, + "env": { "browser": true }, + "rules": + { + "no-alert": "warn", + "no-array-constructor": "warn", + "no-bitwise": "off", + "no-caller": "warn", + "no-case-declarations": "warn", + "no-catch-shadow": "warn", + "no-class-assign": "warn", + "no-cond-assign": "warn", + "no-confusing-arrow": "warn", + "no-console": "off", + "no-const-assign": "warn", + "no-constant-condition": "warn", + "no-continue": "off", + "no-control-regex": "warn", + "no-debugger": "warn", + "no-delete-var": "warn", + "no-div-regex": "warn", + "no-dupe-args": "warn", + "no-dupe-class-members": "warn", + "no-dupe-keys": "warn", + "no-duplicate-case": "warn", + "no-duplicate-imports": "warn", + "no-else-return": "warn", + "no-empty": "warn", + "no-empty-character-class": "warn", + "no-empty-function": "warn", + "no-empty-pattern": "warn", + "no-eq-null": "warn", + "no-eval": "warn", + "no-ex-assign": "warn", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-boolean-cast": "warn", + "no-extra-label": "warn", + "no-extra-parens": "warn", + "no-extra-semi": "warn", + "no-fallthrough": "warn", + "no-floating-decimal": "warn", + "no-func-assign": "warn", + "no-implicit-coercion": ["warn", { "allow": ["~"] }], + "no-implicit-globals": "warn", + "no-implied-eval": "warn", + "no-inline-comments": "warn", + "no-inner-declarations": "warn", + "no-invalid-regexp": "warn", + "no-invalid-this": "off", + "no-irregular-whitespace": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-labels": "warn", + "no-lone-blocks": "warn", + "no-lonely-if": "warn", + "no-loop-func": "off", + "no-magic-numbers": "off", + "no-mixed-operators": "warn", + "no-mixed-requires": "warn", + "no-mixed-spaces-and-tabs": "warn", + "no-multi-spaces": "warn", + "no-multi-str": "warn", + "no-multiple-empty-lines": "warn", + "no-native-reassign": "warn", + "no-negated-condition": "warn", + "no-negated-in-lhs": "warn", + "no-nested-ternary": "off", + "no-new": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-require": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-obj-calls": "warn", + "no-octal": "warn", + "no-octal-escape": "warn", + "no-param-reassign": "warn", + "no-path-concat": "warn", + "no-plusplus": "off", + "no-process-env": "warn", + "no-process-exit": "warn", + "no-proto": "warn", + "no-prototype-builtins": "warn", + "no-redeclare": "warn", + "no-regex-spaces": "warn", + "no-restricted-globals": "warn", + "no-restricted-imports": "warn", + "no-restricted-modules": "warn", + "no-restricted-syntax": "warn", + "no-return-assign": "warn", + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-shadow": "warn", + "no-shadow-restricted-names": "warn", + "no-whitespace-before-property": "warn", + "no-spaced-func": "warn", + "no-sparse-arrays": "warn", + "no-sync": "warn", + "no-tabs": "warn", + "no-ternary": "off", + "no-trailing-spaces": "warn", + "no-this-before-super": "warn", + "no-throw-literal": "warn", + "no-undef": "warn", + "no-undef-init": "warn", + "no-undefined": "off", + "no-unexpected-multiline": "warn", + "no-underscore-dangle": "off", + "no-unmodified-loop-condition": "warn", + "no-unneeded-ternary": "warn", + "no-unreachable": "warn", + "no-unsafe-finally": "warn", + "no-unused-expressions": "warn", + "no-unused-labels": "warn", + "no-unused-vars": "warn", + "no-use-before-define": "warn", + "no-useless-call": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-escape": "warn", + "no-useless-rename": "warn", + "no-void": "warn", + "no-var": "off", + "no-warning-comments": "off", + "no-with": "warn", + "array-bracket-spacing": "off", + "array-callback-return": "warn", + "arrow-body-style": "warn", + "arrow-parens": "warn", + "arrow-spacing": "off", + "accessor-pairs": "warn", + "block-scoped-var": "off", + "block-spacing": ["warn", "always"], + "brace-style": "warn", + "callback-return": "warn", + "camelcase": "off", + "capitalized-comments": + [ + "warn", + "always", + { "ignoreConsecutiveComments": true, "ignoreInlineComments": true }, + ], + "comma-dangle": ["warn", "always-multiline"], + "comma-spacing": ["warn", { "before": false, "after": true }], + "comma-style": "warn", + "complexity": ["warn", 15], + "computed-property-spacing": "off", + "consistent-return": "off", + "consistent-this": "off", + "constructor-super": "warn", + "curly": "warn", + "default-case": "off", + "dot-location": ["warn", "property"], + "dot-notation": "warn", + "eol-last": "warn", + "eqeqeq": "warn", + "func-names": "off", + "func-style": "off", + "generator-star-spacing": "off", + "global-require": "warn", + "guard-for-in": "off", + "handle-callback-err": "warn", + "id-blacklist": "warn", + "id-length": "off", + "id-match": "warn", + "indent": "warn", + "init-declarations": "warn", + "jsx-quotes": "warn", + "key-spacing": "off", + "keyword-spacing": "warn", + "linebreak-style": ["warn", "unix"], + "lines-around-comment": "warn", + "max-depth": "warn", + "max-len": + [ + "warn", + { "code": 88, "ignorePattern": "odoo\\.define\\(", "tabWidth": 4 }, + ], + "max-lines": "off", + "max-nested-callbacks": "warn", + "max-params": "off", + "max-statements": "off", + "max-statements-per-line": "warn", + "multiline-ternary": "off", + "new-cap": "off", + "new-parens": "warn", + "newline-after-var": "off", + "newline-before-return": "off", + "newline-per-chained-call": "off", + "object-curly-newline": ["warn", { "consistent": true }], + "object-curly-spacing": ["warn", "never"], + "object-property-newline": + ["warn", { "allowAllPropertiesOnSameLine": true }], + "object-shorthand": "off", + "one-var": "off", + "one-var-declaration-per-line": "off", + "operator-assignment": "warn", + "operator-linebreak": "warn", + "padded-blocks": "off", + "prefer-arrow-callback": "off", + "prefer-const": "warn", + "prefer-reflect": "off", + "prefer-rest-params": "off", + "prefer-spread": "off", + "prefer-template": "off", + "quote-props": "off", + "quotes": "off", + "radix": "warn", + "require-yield": "warn", + "rest-spread-spacing": "off", + "semi": ["warn", "always"], + "semi-spacing": "warn", + "sort-imports": "warn", + "sort-vars": "off", + "space-before-blocks": "warn", + "space-before-function-paren": "warn", + "space-in-parens": "off", + "space-infix-ops": "off", + "space-unary-ops": "off", + "spaced-comment": ["warn", "always"], + "strict": ["warn", "function"], + "template-curly-spacing": "off", + "unicode-bom": "warn", + "use-isnan": "warn", + "valid-jsdoc": + [ + "warn", + { + "prefer": + { + "arg": "param", + "argument": "param", + "augments": "extends", + "constructor": "class", + "exception": "throws", + "func": "function", + "method": "function", + "prop": "property", + "return": "returns", + "virtual": "abstract", + "yield": "yields", + }, + "preferType": + { + "array": "Array", + "bool": "Boolean", + "boolean": "Boolean", + "number": "Number", + "object": "Object", + "str": "String", + "string": "String", + }, + "requireParamDescription": false, + "requireReturn": false, + "requireReturnDescription": false, + "requireReturnType": false, + }, + ], + "valid-typeof": "warn", + "vars-on-top": "off", + "wrap-iife": "warn", + "wrap-regex": "warn", + "yield-star-spacing": "off", + "yoda": "warn", + }, + "parserOptions": { "ecmaVersion": 2017 }, +} diff --git a/.isort.cfg b/.isort.cfg index 5751c40d..7683badf 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,4 +9,4 @@ line_length=88 known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party= +default_section=THIRDPARTY diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 876d1e98..749967bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,68 +1,102 @@ -exclude: "^setup/|/static/lib/|/static/src/lib/" +exclude: | + (?x) + # Files and folders generated by bots, to avoid loops + ^setup/|/static/description/index\.html$| + # Maybe reactivate this when all README files include prettier ignore tags? + ^README\.md$| + # Library files can have extraneous formatting (even minimized) + /static/(src/)?lib/| + # 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.*) default_language_version: python: python3 repos: -- repo: https://github.com/psf/black - rev: 19.3b0 - hooks: - - id: black -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 - hooks: - - id: trailing-whitespace - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: end-of-file-fixer - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: debug-statements - - id: flake8 - name: flake8 except __init__.py - exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: flake8 - name: flake8 only __init__.py - args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py - files: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: fix-encoding-pragma - args: ["--remove"] - - id: check-case-conflict - - id: check-docstring-first - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-symlinks - - id: check-xml - - id: mixed-line-ending - args: ["--fix=lf"] -- repo: https://github.com/pre-commit/mirrors-pylint - rev: v2.3.1 - hooks: - - id: pylint - name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] - verbose: true - additional_dependencies: ["pylint-odoo==3.0.3"] - - id: pylint - name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.0.3"] -- repo: https://github.com/asottile/pyupgrade - rev: v1.24.0 - hooks: - - id: pyupgrade -- repo: https://github.com/asottile/seed-isort-config - rev: v1.9.3 - hooks: - - id: seed-isort-config -- repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 - hooks: - - id: isort - name: isort except __init__.py - exclude: /__init__\.py$ -- repo: https://github.com/pre-commit/mirrors-eslint - rev: v6.5.1 - hooks: - - id: eslint - verbose: true + - repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black + - repo: https://github.com/prettier/prettier + rev: "1.19.1" + hooks: + - id: prettier + # TODO Avoid awebdeveloper/pre-commit-prettier if possible + # HACK https://github.com/prettier/prettier/issues/7407 + - repo: https://github.com/awebdeveloper/pre-commit-prettier + rev: v0.0.1 + hooks: + - id: prettier + name: prettier xml plugin + additional_dependencies: + - "prettier@1.19.1" + - "@prettier/plugin-xml@0.7.2" + files: \.xml$ + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v6.8.0 + hooks: + - id: eslint + verbose: true + args: + - --color + - --fix + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.4.0 + hooks: + - id: trailing-whitespace + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: end-of-file-fixer + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: debug-statements + - id: fix-encoding-pragma + args: ["--remove"] + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + # exclude files where underlines are not distinguishable from merge conflicts + exclude: /README\.rst$|^docs/.*\.rst$ + - id: check-symlinks + - id: check-xml + - id: mixed-line-ending + args: ["--fix=lf"] + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.9 + hooks: + - id: flake8 + name: flake8 except __init__.py + exclude: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - id: flake8 + name: flake8 only __init__.py + args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py + files: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.3.1 + hooks: + - id: pylint + name: pylint with optional checks + args: ["--rcfile=.pylintrc", "--exit-zero"] + verbose: true + additional_dependencies: ["pylint-odoo==3.1.0"] + - id: pylint + name: pylint with mandatory checks + args: ["--rcfile=.pylintrc-mandatory"] + additional_dependencies: ["pylint-odoo==3.1.0"] + - repo: https://github.com/asottile/pyupgrade + rev: v1.26.2 + hooks: + - id: pyupgrade + - repo: https://github.com/pre-commit/mirrors-isort + rev: v4.3.21 + hooks: + - id: isort + name: isort except __init__.py + exclude: /__init__\.py$ + - repo: https://github.com/acsone/setuptools-odoo + rev: 2.5.2 + hooks: + - id: setuptools-odoo-make-default diff --git a/.travis.yml b/.travis.yml index 2d1d80fb..0489611f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python cache: directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit + - $HOME/.cache/pip + - $HOME/.cache/pre-commit python: - "3.6" @@ -11,7 +11,7 @@ addons: postgresql: "9.6" apt: packages: - - expect-dev # provides unbuffer utility + - expect-dev # provides unbuffer utility stages: - linting @@ -34,7 +34,7 @@ jobs: env: global: - - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" install: - git clone -b master-eficent https://github.com/ForgeFlow/maintainer-quality-tools.git $HOME/maintainer-quality-tools diff --git a/rma/data/rma_operation.xml b/rma/data/rma_operation.xml index 9d1fc02f..92e3fec0 100644 --- a/rma/data/rma_operation.xml +++ b/rma/data/rma_operation.xml @@ -1,4 +1,4 @@ - + Replace After Receive @@ -6,8 +6,8 @@ ordered received customer - - + + @@ -16,8 +16,8 @@ ordered ordered supplier - - + + @@ -26,9 +26,9 @@ ordered no customer - - - + + + @@ -37,9 +37,9 @@ no ordered supplier - - - + + + diff --git a/rma/data/rma_sequence.xml b/rma/data/rma_sequence.xml index d025881e..db71c5ca 100644 --- a/rma/data/rma_sequence.xml +++ b/rma/data/rma_sequence.xml @@ -1,12 +1,12 @@ - + Customer RMA sequence rma.order.customer 5 RMAG/%(year)s/ - - + + @@ -14,9 +14,9 @@ rma.order.supplier 5 RTVG/%(year)s/ - - - + + + @@ -24,9 +24,9 @@ rma.order.line.customer 5 RMA/%(year)s/ - - - + + + @@ -34,9 +34,9 @@ rma.order.line.supplier 5 RTV/%(year)s/ - - - + + + diff --git a/rma/data/stock_data.xml b/rma/data/stock_data.xml index 08d4e687..eab5ee67 100644 --- a/rma/data/stock_data.xml +++ b/rma/data/stock_data.xml @@ -1,216 +1,233 @@ - + WH RMA internal - + DOC RCO 5 - + INC RCI 5 - + DOS RSO 5 - + INS RSI 5 - + DSS DSS 5 - + RMA → Customer - + RMA → Customer - - - + + + outgoing Customer → RMA - + Customer → RMA - - - + + + incoming RMA -> Supplier - + RMA -> Supplier - - - + + + outgoing Supplier -> RMA - + Supplier -> RMA - - - + + + incoming Customer -> Supplier - + Customer -> Supplier - - - + + + incoming Supplier -> Customer - + Supplier -> Customer - - - + + + incoming - - - - - + + + + + RMA Customer - + 10 - - - - + + + + RMA Supplier - + 10 - - - - + + + + RMA Dropship - + 10 - - - - + + + + Customer → RMA pull - - - + + + make_to_stock - - + + RMA → Customer pull - - - + + + make_to_stock - - + + RMA → Supplier pull - - - + + + make_to_stock - - + + Supplier → RMA pull - - - + + + make_to_stock - - + + Customer → Supplier pull - - + + make_to_stock - - + + Supplier → Customer pull - - + + make_to_stock - - + + diff --git a/rma/demo/stock_demo.xml b/rma/demo/stock_demo.xml index 0c22b4df..8149b189 100644 --- a/rma/demo/stock_demo.xml +++ b/rma/demo/stock_demo.xml @@ -1,4 +1,4 @@ - + @@ -6,57 +6,65 @@ RMA Customer Sequence out RMA/CUST/OUT 5 - + RMA Customer Sequence in RMA/CUST/IN 5 - + RMA Supplier Sequence out RMA/SUPP/OUT 5 - + RMA Supplier Sequence in RMA/SUPP/IN 5 - + RMA Dropship RMA/DS 5 - + Customer -> Supplier - - - - + + + + incoming Supplier -> Customer - - - - + + + + incoming @@ -64,58 +72,59 @@ RMA Customer 10 - - - - + + + + RMA Supplier 10 - - - - + + + + RMA Dropship 10 - - - - + + + + Customer → Supplier pull - - - + + + make_to_stock - - + + Supplier → Customer pull - - - + + + make_to_stock - - + + - + diff --git a/rma/report/rma_report.xml b/rma/report/rma_report.xml index b2222392..531fb5cb 100644 --- a/rma/report/rma_report.xml +++ b/rma/report/rma_report.xml @@ -1,4 +1,4 @@ - + +