Merge PR #890 into 15.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-11-03 11:23:38 +00:00
5 changed files with 15 additions and 12 deletions

View File

@@ -1,9 +1,14 @@
# Do NOT update manually; changes here will be overwritten by Copier # Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.5.2 _commit: v1.11.0
_src_path: gh:oca/oca-addons-repo-template _src_path: gh:oca/oca-addons-repo-template
ci: GitHub ci: GitHub
dependency_installation_mode: PIP dependency_installation_mode: PIP
generate_requirements_txt: true generate_requirements_txt: true
github_check_license: true
github_enable_codecov: true
github_enable_makepot: true
github_enable_stale_action: true
github_enforce_dev_status_compatibility: true
include_wkhtmltopdf: false include_wkhtmltopdf: false
odoo_version: 15.0 odoo_version: 15.0
org_name: Odoo Community Association (OCA) org_name: Odoo Community Association (OCA)
@@ -15,3 +20,4 @@ repo_slug: contract
repo_website: https://github.com/OCA/contract repo_website: https://github.com/OCA/contract
travis_apt_packages: [] travis_apt_packages: []
travis_apt_sources: [] travis_apt_sources: []

1
.gitignore vendored
View File

@@ -15,7 +15,6 @@ build/
develop-eggs/ develop-eggs/
dist/ dist/
eggs/ eggs/
lib/
lib64/ lib64/
parts/ parts/
sdist/ sdist/

View File

@@ -119,19 +119,15 @@ repos:
- id: flake8 - id: flake8
name: flake8 name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"] additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/PyCQA/pylint - repo: https://github.com/OCA/pylint-odoo
rev: v2.11.1 rev: 7.0.2
hooks: hooks:
- id: pylint - id: pylint_odoo
name: pylint with optional checks name: pylint with optional checks
args: args:
- --rcfile=.pylintrc - --rcfile=.pylintrc
- --exit-zero - --exit-zero
verbose: true verbose: true
additional_dependencies: &pylint_deps - id: pylint_odoo
- pylint-odoo==5.0.5
- id: pylint
name: pylint with mandatory checks
args: args:
- --rcfile=.pylintrc-mandatory - --rcfile=.pylintrc-mandatory
additional_dependencies: *pylint_deps

View File

@@ -309,10 +309,11 @@ class ContractContract(models.Model):
if date_end and all(date_end): if date_end and all(date_end):
contract.date_end = max(date_end) contract.date_end = max(date_end)
# pylint: disable=missing-return
@api.depends( @api.depends(
"contract_line_ids.recurring_next_date", "contract_line_ids.recurring_next_date",
"contract_line_ids.is_canceled", "contract_line_ids.is_canceled",
) # pylint: disable=missing-return )
def _compute_recurring_next_date(self): def _compute_recurring_next_date(self):
for contract in self: for contract in self:
recurring_next_date = contract.contract_line_ids.filtered( recurring_next_date = contract.contract_line_ids.filtered(

View File

@@ -106,9 +106,10 @@ class ContractLine(models.Model):
readonly=True, readonly=True,
) )
# pylint: disable=missing-return
@api.depends( @api.depends(
"last_date_invoiced", "date_start", "date_end", "contract_id.last_date_invoiced" "last_date_invoiced", "date_start", "date_end", "contract_id.last_date_invoiced"
) # pylint: disable=missing-return )
def _compute_next_period_date_start(self): def _compute_next_period_date_start(self):
"""Rectify next period date start if another line in the contract has been """Rectify next period date start if another line in the contract has been
already invoiced previously when the recurrence is by contract. already invoiced previously when the recurrence is by contract.