Skip to content

Commit

Permalink
Merge branch '16.0' into 16.0-mig-repair_calendar_view
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuaristi authored Jul 15, 2024
2 parents 65dfb1b + c5a4d97 commit be0cf6d
Show file tree
Hide file tree
Showing 83 changed files with 977 additions and 401 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
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:
- "16.0*"
push:
branches:
- "16.0"
- "16.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
5 changes: 4 additions & 1 deletion .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 All @@ -15,7 +16,6 @@ build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -70,3 +70,6 @@ docs/_build/
# Backup files
*~
*.swp

# OCA rules
!static/lib/
37 changes: 24 additions & 13 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: 1faff6d90f8a0d189aad3f148c5fc72df3117193
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-repair-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: v2.3.1
hooks:
- id: autoflake
args:
Expand All @@ -51,30 +62,30 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: prettier (with plugin-xml)
additional_dependencies:
- "prettier@2.7.1"
- "@prettier/plugin-xml@2.2.0"
- "prettier@2.1.2"
- "@prettier/plugin-xml@0.12.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: v8.48.0
rev: v8.24.0
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
Expand All @@ -96,20 +107,20 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.16.0
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.1.12
rev: "3.3"
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: 7.1.0
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.20
rev: v9.1.2
hooks:
- id: pylint_odoo
name: pylint with optional checks
Expand Down
12 changes: 6 additions & 6 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 @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>

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,
Expand All @@ -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 <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -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/>.
<https://www.gnu.org/licenses/>.
1 change: 0 additions & 1 deletion mrp_repair_cancel_reason/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import wizard
Expand Down
39 changes: 20 additions & 19 deletions mrp_repair_cancel_reason/__manifest__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'MRP Repair Cancel Reason',
"name": "MRP Repair Cancel Reason",
"version": "16.0.1.0.0",
"license": 'AGPL-3',
"author": 'AvanzOSC',
'website': "http://www.odoomrp.com",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-repair-addons",
"contributors": [
"Ana Juaristi <[email protected]>",
"Alfredo de la Fuente <[email protected]>",
],
'category': 'Manufacturing',
'depends': ['product',
'stock',
'mrp',
'repair',
],
'data': ['security/ir.model.access.csv',
'data/repair_order_cancel_reason.xml',
'wizard/wiz_repair_order_cancel_reason_view.xml',
'views/repair_order_view.xml',
'views/repair_order_cancel_reason_view.xml',
],
'installable': True,
],
"category": "Manufacturing",
"depends": [
"product",
"stock",
"mrp",
"repair",
],
"data": [
"security/ir.model.access.csv",
"data/repair_order_cancel_reason.xml",
"wizard/wiz_repair_order_cancel_reason_view.xml",
"views/repair_order_view.xml",
"views/repair_order_cancel_reason_view.xml",
],
"installable": True,
}
14 changes: 6 additions & 8 deletions mrp_repair_cancel_reason/data/repair_order_cancel_reason.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="mrp_cancel_reason_customer" model="repair.order.cancel.reason">
<field name="name">Canceled at customer request</field>
</record>
</data>
</openerp>
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="mrp_cancel_reason_customer" model="repair.order.cancel.reason">
<field name="name">Canceled at customer request</field>
</record>
</odoo>
1 change: 0 additions & 1 deletion mrp_repair_cancel_reason/models/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import repair_order
18 changes: 10 additions & 8 deletions mrp_repair_cancel_reason/models/repair_order.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models, fields
from odoo import fields, models


class MrpRepair(models.Model):
_inherit = 'repair.order'
_inherit = "repair.order"

cancel_reason_id = fields.Many2one(
'repair.order.cancel.reason', string='Reason for cancellation',
readonly=True, ondelete='restrict')
"repair.order.cancel.reason",
string="Reason for cancellation",
readonly=True,
ondelete="restrict",
)


class MrpRepairCancelReason(models.Model):
_name = 'repair.order.cancel.reason'
_description = 'Repair Cancel Reason'
_name = "repair.order.cancel.reason"
_description = "Repair Cancel Reason"

name = fields.Char('Reason', required=True, translate=True)
name = fields.Char("Reason", required=True, translate=True)
Empty file modified mrp_repair_cancel_reason/security/ir.model.access.csv
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion mrp_repair_cancel_reason/tests/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_repair_order_cancel_reason
Loading

0 comments on commit be0cf6d

Please sign in to comment.