Skip to content

Commit

Permalink
Merge branch '14.0' into 14.0-add-account_move_line_vehicle_search
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Jul 9, 2024
2 parents d490f35 + 647a7a9 commit 67e3497
Show file tree
Hide file tree
Showing 2,447 changed files with 50,116 additions and 27,407 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# eslint complains on website_bootstrap_select
website_bootstrap_select/static/src/js/*.js
website_bootstrap_select/static/src/js/*/*.js
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
47 changes: 29 additions & 18 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/odoo-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 @@ -65,16 +76,16 @@ repos:
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
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
# - repo: https://github.com/pre-commit/mirrors-eslint
# 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
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/>.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[![Build Status](https://travis-ci.org/avanzosc/odoo-addons.svg?branch=14.0)](https://travis-ci.org/avanzosc/odoo-addons)
[![Code Health](https://landscape.io/github/avanzosc/odoo-addons/14.0/landscape.svg?style=flat)](https://landscape.io/github/avanzosc/odoo-addons/14.0)
[![Coverage Status](https://coveralls.io/repos/avanzosc/odoo-addons/badge.svg?branch=14.0)](https://coveralls.io/r/avanzosc/odoo-addons?branch=14.0)
[![Codacy Badge](https://www.codacy.com/project/badge/5c3b8125c017437f9f208bdd6f984915)](https://www.codacy.com/public/oihanecruce/odoo-addons)
[![codecov](https://codecov.io/gh/avanzosc/odoo-addons/branch/14.0/graph/badge.svg)](https://codecov.io/gh/avanzosc/odoo-addons)
[![pre-commit](https://github.com/avanzosc/odoo-addons/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/avanzosc/odoo-addons/actions/workflows/pre-commit.yml)

Odoo addons
===========
Expand Down
2 changes: 1 addition & 1 deletion account_analytic_distribution/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import models
from . import models
4 changes: 2 additions & 2 deletions account_analytic_distribution/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Account Analytic Distribution",
'version': '14.0.1.0.0',
"version": "14.0.1.0.0",
"category": "Analytic",
"license": "AGPL-3",
"author": "AvanzOSC",
Expand All @@ -21,5 +21,5 @@
"views/account_account_view.xml",
"views/account_analytic_template_view.xml",
],
'installable': True,
"installable": True,
}
3 changes: 2 additions & 1 deletion account_analytic_distribution/models/account_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ class AccountAccount(models.Model):
analytic_template_ids = fields.One2many(
string="Analytic Distribution",
comodel_name="account.analytic.template",
inverse_name="account_id")
inverse_name="account_id",
)
11 changes: 7 additions & 4 deletions account_analytic_distribution/models/account_analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

pre_amount = fields.Float(
string="Amount")
pre_amount = fields.Float(string="Amount")

@api.onchange("pre_amount")
def onchange_pre_amount(self):
Expand All @@ -18,7 +17,11 @@ def onchange_pre_amount(self):
@api.model
def create(self, values):
if "name" in values and values["name"] == "/ -- /" and "move_id" in values:
values["name"] = self.env["account.move.line"].browse(values.get("move_id")).account_id.display_name
values["name"] = (
self.env["account.move.line"]
.browse(values.get("move_id"))
.account_id.display_name
)
if "amount" in values:
values["pre_amount"] = values["amount"]
return super(AccountAnalyticLine, self).create(values)
return super().create(values)
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ class AccountAnalyticTemplate(models.Model):
_name = "account.analytic.template"
_description = "Account Analytic Template"

account_id = fields.Many2one(
string="Account",
comodel_name="account.account")
account_id = fields.Many2one(string="Account", comodel_name="account.account")
account_analytic_id = fields.Many2one(
string="Account Analytic",
comodel_name="account.analytic.account")
percentage = fields.Float(
string="%")
string="Account Analytic", comodel_name="account.analytic.account"
)
percentage = fields.Float(string="%")
company_id = fields.Many2one(
string="Company",
comodel_name="res.company",
related="account_analytic_id.company_id",
store=True)
store=True,
)
Loading

0 comments on commit 67e3497

Please sign in to comment.