From 25997d6a8824a9ea3f2fe2cfcb86042542773897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Thu, 10 Dec 2020 10:50:36 +0100 Subject: [PATCH] [ADD] add copier and precommit file for V14 --- .copier-answers.yml | 13 +++++ .gitignore | 6 +-- .pre-commit-config.yaml | 112 +++++++++++++++++++++++++--------------- .prettierrc.yml | 2 +- .pylintrc | 6 +-- .pylintrc-mandatory | 4 +- .travis.yml | 10 ++-- CONTRIBUTING.md | 4 +- LICENSE | 12 ++--- README.md | 108 ++++++++------------------------------ oca_dependencies.txt | 27 +--------- 11 files changed, 125 insertions(+), 179 deletions(-) create mode 100644 .copier-answers.yml diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000000..36c3dd0392 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,13 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: v1.0.3 +_src_path: gh:oca/oca-addons-repo-template +dependency_installation_mode: PIP +generate_requirements_txt: true +include_wkhtmltopdf: false +odoo_version: 14.0 +rebel_module_groups: [] +repo_description: "TODO: add repo description." +repo_name: wms +repo_slug: wms +travis_apt_packages: [] +travis_apt_sources: [] diff --git a/.gitignore b/.gitignore index a8a1e362b3..818770fb1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ -# Project specific -oca.cfg - # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.pytest_cache # C extensions *.so @@ -40,7 +39,6 @@ coverage.xml # Translations *.mo -*.pot # Pycharm .idea diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6aa35c80f..e0986311b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,13 @@ exclude: | (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS # 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) - lib/| + /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 @@ -14,39 +16,51 @@ default_language_version: python: python3 node: "14.13.0" repos: + - repo: local + hooks: + # These files are most likely copier diff rejection junks; if found, + # review them manually, fix the problem (if needed) and remove them + - id: forbidden-files + name: forbidden files + entry: found forbidden files; remove them + language: fail + files: "\\.rej$" + - repo: https://github.com/oca/maintainer-tools + rev: 1b5c7ad + 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/wms"] + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + args: ["-i", "--ignore-init-module-imports"] - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black - repo: https://github.com/prettier/pre-commit - rev: "v1.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 + rev: v2.1.2 hooks: - id: prettier - name: prettier xml plugin + name: prettier + plugin-xml additional_dependencies: - - "prettier@1.19.1" - - "@prettier/plugin-xml@0.7.2" - files: \.xml$ + - "prettier@2.1.2" + - "@prettier/plugin-xml@0.12.0" + args: + - --plugin=@prettier/plugin-xml - repo: https://github.com/pre-commit/mirrors-eslint - rev: v6.8.0 + rev: v7.8.1 hooks: - id: eslint verbose: true args: - --color - --fix - # SPECIAL CASE: barcode scanner app use Vue.js + - # advanced JS (modules, classes, etc) - # which are not supported by OCA rules yet. - exclude: shopfloor_mobile/* - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v3.2.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -67,41 +81,53 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + - repo: https://github.com/asottile/pyupgrade + rev: v2.7.2 + hooks: + - id: pyupgrade + - repo: https://github.com/PyCQA/isort + rev: 5.5.1 + hooks: + - id: isort + name: isort except __init__.py + args: + - --settings=. + exclude: /__init__\.py$ + - repo: https://github.com/acsone/setuptools-odoo + rev: 2.6.0 + 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.8.3 hooks: - id: flake8 name: flake8 except __init__.py exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] + additional_dependencies: ["flake8-bugbear==20.1.4"] - 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.5.3 + additional_dependencies: ["flake8-bugbear==20.1.4"] + - repo: https://github.com/PyCQA/pylint + rev: pylint-2.5.3 hooks: - id: pylint name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] + args: + - --rcfile=.pylintrc + - --exit-zero verbose: true - additional_dependencies: ["pylint-odoo==3.5.0"] + additional_dependencies: &pylint_deps + - pylint-odoo==3.5.0 - id: pylint name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.5.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 + args: + - --rcfile=.pylintrc-mandatory + additional_dependencies: *pylint_deps diff --git a/.prettierrc.yml b/.prettierrc.yml index fc5f3a7c4d..5b6d4b361a 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -5,4 +5,4 @@ printWidth: 88 proseWrap: always semi: true trailingComma: "es5" -xmlWhitespaceSensitivity: "ignore" +xmlWhitespaceSensitivity: "strict" diff --git a/.pylintrc b/.pylintrc index 485836baf4..e33958833e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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=13.0 +valid_odoo_versions=14.0 [MESSAGES CONTROL] disable=all @@ -46,8 +46,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, @@ -73,6 +71,7 @@ enable=anomalous-backslash-in-string, deprecated-module, file-not-used, invalid-commit, + missing-manifest-dependency, missing-newline-extrafiles, missing-readme, no-utf8-coding-comment, @@ -82,6 +81,7 @@ enable=anomalous-backslash-in-string, too-complex, unnecessary-utf8-coding-comment + [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} output-format=colorized diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 55893fe8b6..08bca3cefe 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -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=13.0 +valid_odoo_versions=14.0 [MESSAGES CONTROL] disable=all @@ -39,8 +39,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, diff --git a/.travis.yml b/.travis.yml index 694bf2d731..4b5ed106df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,20 +21,20 @@ jobs: include: - stage: linting name: "pre-commit" - before_install: install: pip install pre-commit script: pre-commit run --all --show-diff-on-failure --verbose --color always after_success: + before_install: - stage: test env: - - TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1" MQT_DEP="PIP" + - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - stage: test env: - - TESTS="1" ODOO_REPO="OCA/OCB" MQT_DEP="PIP" - + - TESTS=1 ODOO_REPO="OCA/OCB" env: global: - - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - MQT_DEP=PIP install: - git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f7056a809..9ac71fee42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,10 @@ # OCA Guidelines Please follow the official guide from the -[OCA Guidelines page](https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md). +[OCA Guidelines page](https://odoo-community.org/page/contributing). ## Project Specific Guidelines + + This project does not have specific coding guidelines. diff --git a/LICENSE b/LICENSE index 58777e31af..be3f7b28e5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -GNU AFFERO GENERAL PUBLIC LICENSE + GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -658,4 +658,4 @@ specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see -. +. diff --git a/README.md b/README.md index 29740db782..34c3f8e84f 100644 --- a/README.md +++ b/README.md @@ -1,102 +1,36 @@ -[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/285/13.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-wms-285) -[![Build Status](https://travis-ci.com/OCA/wms.svg?branch=13.0)](https://travis-ci.com/OCA/wms) -[![codecov](https://codecov.io/gh/OCA/wms/branch/13.0/graph/badge.svg)](https://codecov.io/gh/OCA/wms) +[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/285/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-wms-285) +[![Build Status](https://travis-ci.com/OCA/wms.svg?branch=14.0)](https://travis-ci.com/OCA/wms) +[![codecov](https://codecov.io/gh/OCA/wms/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/wms) +[![Translation Status](https://translation.odoo-community.org/widgets/wms-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/wms-14-0/?utm_source=widget) -# WMS - Warehouse Management System + -Warehouse Management System for advanced logistics processes with Odoo. Work in progress, tracked in this issue https://github.com/OCA/wms/issues/29 +# wms -## References +TODO: add repo description. - - The WMS presentation made during Odoo XP 2020 [here](https://docs.google.com/presentation/d/1mYOCAaaVWZtCUDbslwIZyOT9_hHezbWkJVXxu0k01fw/edit) or watch the video [here](https://www.youtube.com/watch?v=Jy4JHBlN7HY) - - The Barcode App presentation made during the OCA days 2020 [here](https://docs.google.com/presentation/d/1nTX_fR9V73y1Qquotf3iiom5kvTNZLfj-3DfgirR29I/edit?pli=1#slide=id.p1) + -![General module architecture](https://user-images.githubusercontent.com/151794/65694568-5c406e80-e076-11e9-8d1c-37716c0ef4b3.png) + +[//]: # (addons) -## Dynamic routing of operation +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. -Classify operation depending on where they are reserved, manage handover places, creates different goods flow by carriers. Route explains the steps you want to produce whereas the “picking routing operation” defines how operations are grouped according to their final source -and destination location. +[//]: # (end addons) -## Packaging management + -To better manage the product packaging we need to have them properly defined for each product and classify them by type. Most common type are usually: - - Retail box - - Transport box - - Pallet - -It is a basic requirement for improved reservation rules, efficient barcode operation and usage of measurement machines such as Cubiscan for example. - -## Put away based on storage type, ABC class and constraints (height, weight,..) - -Define storage type on location and attribute storage type on PACK. Storage type can also be define on product packaging to help filling up the info while receiving products. -The idea is that anything getting in the warehouse is given a unique PACK ID with proper storage type and attributes (height, weight, etc..). Product are classified in A,B,C Class as well as location depending on their accessibility for optimized chaotic storage. -Put away will then compute the proper location based on those information. - -## Reservation rules by packaging and location - -Provide configurable reservation rule by location and packaging type with sequence. Thus allows to drive reservation differently depending on the packaging type to retrieve. For example, pick first pallets from Location A and then boxes from location B. - -It supports several removal strategies: default FIFO/FEFO prefer packaging or empty bin to favor emptying spaces over anything else. - -## Virtual reservation and release of operations - -Make the final stock reservation when needed, decoupled from the order confirmation while respecting the order of arrival through virtual reservation. Thus also helps to create internal operations such as pick or ship when required only. - -When operation release occurs, only create moves for the goods we have in stocks. This will avoid having backorder in internal warehouse operations (only the delivery order will have one). - -## Delivery windows, weekly delivery and cut-off time - -Define delivery windows for your customers where they can receive your goods. Setup weekly day of delivery if required. Handle cut-off time by customer depending on where they are. - -## Group and consolidate your shipment for several orders - -Group several orders into one consolidated shipment by carrier during packing operations. - -## Manage replenishment zone - -Re-allocate your needs for stocks to drive your replenishment operations within your location (from a pallet storage to a shelving one for example). This allows you to re-allocate a missing stock quantity to a given location to wait for stock there while performing replenishment (technically, it allows to change the source of a stock move to make it hit a stock rule). - -## Advanced barcode scanner - -Decouple transactional Odoo documents and flows toward an efficient shop-floor process. Do not rely on finding the proper operation to process, but scan location and package to deduce what to do with it. Proceed with operation by machine type or zone rather than Odoo document. Get optimized path computed properly. - -Configure your barcode menu, chose which scanning process to apply to each operation, allow to process several operation type within a same barcode menu. - -Provide state of the art logistics features to handle zero checks, inventory errors and stock out, etc.. - -## Warehouse map - -Allow to represent the warehouse map precisely by defining relevant attributes and naming convention. Thus will also constitute a per-requisit for having a proper path computed while making an optimized picking tour. - -## Interface with measurement machine - -Here with Cubiscan, but interface might serve as a base for other brand. - -## Interface with vertical automated storage - -Provide the proper interface and link to connect vertical lift machines such as Kardex. - -## Minimum shelf-life - -Ensure a minimum shelf life to your customers. - -## Manage dangerous goods - -Handle proper attributes and report for dangerous goods handling in respect to EU legislation. - -# Reference document - - - Draft of the requirements: https://docs.google.com/document/d/1mct6bFFWJqW01wGFcjc-uQNEjyCxvh6Y9TuFdRhe-b0/edit#heading=h.k0bwq3398e7m - - OCA Days 2019 presentation: https://docs.google.com/presentation/d/1wTbnkjvbId3lZHTCB-VfNr8pDqAFKC4N4UnoIAQEpbo/edit#slide=id.g61dc817660_0_25 - - Barcode draft RFC document : https://docs.google.com/document/d/1acxlz8W7j4Ljhr2KvcJEUYDInejwjRMq2U9Q91gmEEU/edit - - Barcode Requirements: https://docs.google.com/presentation/d/1A5TVJXryqod7IwVIl03mDUJIUGzqJ-T2FzSWA90zAvw/edit?disco=AAAAGUSCd54&ts=5e749d4d +## Licenses +This repository is licensed under [AGPL-3.0](LICENSE). +However, each module can have a totally different license, as long as they adhere to OCA +policy. Consult each module's `__manifest__.py` file, which contains a `license` key +that explains its license. ---- -OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. +OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit +organization whose mission is to support the collaborative development of Odoo features +and promote its widespread use. diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 6289367203..ca3c726ba2 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,26 +1 @@ -# List the OCA project dependencies, one per line -# Add a repository url and branch if you need a forked version -# -# Examples -# ======== -# -# To depend on the standard version of sale-workflow, use: -# sale-workflow -# -# To explicitely give the URL of a fork, and still use the version specified in -# .travis.yml, use: -# sale-workflow https://github.com/OCA/sale-workflow -# -# To provide both the URL and a branch, use: -# sale-workflow https://github.com/OCA/sale-workflow branchname -# -# To use a specific commit version, set the branch (required) and the -# commit SHA to select: -# sale-workflow https://github.com/OCA/sale-workflow branchname f848e37 - -product-attribute -server-tools -stock-logistics-workflow -web -rest-framework -server-auth +# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt