Skip to content

Commit

Permalink
Merge branch '14.0' into 14.0-add-mrp_bom_structure_xlsx_cost
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis authored Jul 8, 2024
2 parents 126b15c + 0b8680e commit 38e2874
Show file tree
Hide file tree
Showing 267 changed files with 4,942 additions and 2,431 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ globals:
odoo: readonly
openerp: readonly
owl: readonly
luxon: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
Expand Down
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ select = C,E,F,W,B,B9
# E203: whitespace before ':' (black behaviour)
# E501: flake8 line length (covered by bugbear B950)
# W503: line break before binary operator (black behaviour)
ignore = E203,E501,W503
# C901: Function is too complex
ignore = E203,E501,W503,C901
per-file-ignores=
__init__.py:F401
46 changes: 46 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: pre-commit

on:
pull_request:
branches:
- "14.0*"
push:
branches:
- "14.0"
- "14.0-ocabot-*"

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
env:
# Consider valid a PR that changes README fragments but doesn't
# change the README.rst file itself. It's not really a problem
# because the bot will update it anyway after merge. This way, we
# lower the barrier for functional contributors that want to fix the
# readme fragments, while still letting developers get README
# auto-generated (which also helps functionals when using runboat).
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
SKIP: oca-gen-addon-readme
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
if [ "$newfiles" != "" ] ; then
echo "Please check-in the following files:"
echo "$newfiles"
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
/.venv
/.pytest_cache
/.ruff_cache

# C extensions
*.so
Expand Down
33 changes: 22 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ exclude: |
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# Don't bother non-technical authors with formatting issues in docs
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# Ignore test files in addons
/tests/samples/.*|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
Expand All @@ -33,14 +39,19 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: 969238e47c07d0c40573acff81d170f63245d738
rev: 9a170331575a265c092ee6b24b845ec508e8ef75
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://github.com/avanzosc/mrp-addons"]
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
- repo: https://github.com/myint/autoflake
rev: v2.2.1
rev: v1.4
hooks:
- id: autoflake
args:
Expand All @@ -51,11 +62,11 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v2.1.2
hooks:
- id: prettier
name: prettier (with plugin-xml)
Expand All @@ -66,15 +77,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.48.0
rev: v7.8.1
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v3.2.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
Expand All @@ -96,7 +107,7 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v2.7.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
Expand All @@ -109,7 +120,7 @@ repos:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.1.12
rev: 3.1.8
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
Expand All @@ -119,13 +130,13 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 3.8.3
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.20
rev: 7.0.2
hooks:
- id: pylint_odoo
name: pylint with optional checks
Expand Down
33 changes: 0 additions & 33 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,6 @@ 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,
external-request-timeout,
# messages that do not cause the lint step to fail
consider-merging-classes-inherited,
create-user-wo-reset-password,
Expand Down
35 changes: 1 addition & 34 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,7 @@ enable=anomalous-backslash-in-string,
unreachable,
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,
external-request-timeout
xml-syntax-error

[REPORTS]
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
Expand Down
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
language: python
sudo: false
cache: pip

python:
- "3.6"

sudo: false
cache: pip

addons:
postgresql: "9.6"
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- python-unidecode
- antiword # document module
- cups
- libcups2-dev

env:
global:
- VERSION="14.0" TESTS="0" LINT_CHECK="0"
- VERSION="14.0" TESTS="0" LINT_CHECK="0" WKHTMLTOPDF_VERSION="0.12.4"
matrix:
- LINT_CHECK="1"
- TESTS="1" ODOO_REPO="OCA/OCB"
Expand All @@ -29,10 +27,11 @@ install:
- git clone --depth=1 https://github.com/avanzosc/maintainer-quality-tools.git
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- pip install unidecode
- travis_install_nightly

script:
- travis_wait travis_run_tests
- travis_run_tests

after_success:
- travis_after_tests_success
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -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
<http://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.
3 changes: 2 additions & 1 deletion custom_mrp_descarga/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"category": "MRP",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "http://www.avanzosc.es",
"website": "https://github.com/avanzosc/mrp-addons",
"depends": [
"custom_mrp_line_cost",
"custom_descarga",
Expand Down Expand Up @@ -36,6 +36,7 @@
"views/stock_move_line_view.xml",
"views/killing_cost_view.xml",
"report/mrp_production_summary_xlsx.xml",
"report/mrp_production_quartering_summary_xlsx.xml",
],
"installable": True,
"auto_install": True,
Expand Down
25 changes: 12 additions & 13 deletions custom_mrp_descarga/data/ir_sequence.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<odoo>
<data noupdate="1">
<record id="quartering_sequence" model="ir.sequence">
<field name="name">Secuencia para órdenes de producción de despiece</field>
<field name="prefix">DESP/</field>
<field name="padding">5</field>
</record>
<record id="classified_sequence" model="ir.sequence">
<field name="name">Secuencia para órdenes de producción de clasificado</field>
<field name="prefix">CLAS/</field>
<field name="padding">5</field>
</record>
</data>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="quartering_sequence" model="ir.sequence">
<field name="name">Secuencia para órdenes de producción de despiece</field>
<field name="prefix">DESP/</field>
<field name="padding">5</field>
</record>
<record id="classified_sequence" model="ir.sequence">
<field name="name">Secuencia para órdenes de producción de clasificado</field>
<field name="prefix">CLAS/</field>
<field name="padding">5</field>
</record>
</odoo>
27 changes: 16 additions & 11 deletions custom_mrp_descarga/data/mrp_bom_category.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<odoo>
<data noupdate="1">
<record id="quartering_category" model="mrp.bom.category">
<field name="name">Despiece</field>
<field name="sequence_id" eval="ref('custom_mrp_descarga.quartering_sequence')"/>
</record>
<record id="classified_category" model="mrp.bom.category">
<field name="name">Clasificado</field>
<field name="sequence_id" eval="ref('custom_mrp_descarga.classified_sequence')"/>
</record>
</data>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="quartering_category" model="mrp.bom.category">
<field name="name">Despiece</field>
<field
name="sequence_id"
eval="ref('custom_mrp_descarga.quartering_sequence')"
/>
</record>
<record id="classified_category" model="mrp.bom.category">
<field name="name">Clasificado</field>
<field
name="sequence_id"
eval="ref('custom_mrp_descarga.classified_sequence')"
/>
</record>
</odoo>
Loading

0 comments on commit 38e2874

Please sign in to comment.