Skip to content

Commit

Permalink
[IMP] update dotfiles [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed Mar 30, 2022
1 parent 087fbe0 commit 3b955f8
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 38 deletions.
5 changes: 4 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.3.6
_commit: v1.5.2
_src_path: gh:oca/oca-addons-repo-template
ci: Travis
dependency_installation_mode: PIP
generate_requirements_txt: true
include_wkhtmltopdf: false
odoo_version: 14.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups: []
repo_description: 'TODO: add repo description.'
repo_name: credit-control
repo_slug: credit-control
repo_website: https://github.com/OCA/credit-control
travis_apt_packages: []
travis_apt_sources: []
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2019

overrides:
- files:
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@ name: pre-commit

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

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
# The pylint-odoo version we use here does not support python 3.10
# https://github.com/OCA/oca-addons-repo-template/issues/80
# We also need to pin to an older version of python for older odoo versions
# where we are not using black > 21. Older black versions won't work with
# Python 3.9.8+, and we can't bump black without reformatting.
python-version: "3.9.7"
- uses: pre-commit/action@v2.0.0
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
- 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down Expand Up @@ -120,7 +120,7 @@ repos:
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
rev: v2.11.1
hooks:
- id: pylint
name: pylint with optional checks
Expand All @@ -129,7 +129,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- pylint-odoo==5.0.5
- id: pylint
name: pylint with mandatory checks
args:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/262/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-credit-control-262)

[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/credit-control&target_branch=14.0)
[![Build Status](https://travis-ci.com/OCA/credit-control.svg?branch=14.0)](https://travis-ci.com/OCA/credit-control)
[![codecov](https://codecov.io/gh/OCA/credit-control/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/credit-control)
[![Translation Status](https://translation.odoo-community.org/widgets/credit-control-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/credit-control-14-0/?utm_source=widget)
Expand Down Expand Up @@ -37,12 +38,11 @@ addon | version | maintainers | summary

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
However, each module can have a totally different license, as long as they adhere to Odoo Community Association (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.
2 changes: 1 addition & 1 deletion account_credit_control/models/account_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class AccountAccount(models.Model):
""" Add a link to a credit control policy on account.account """
"""Add a link to a credit control policy on account.account"""

_inherit = "account.account"

Expand Down
4 changes: 2 additions & 2 deletions account_credit_control/models/credit_control_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_email(self):
def _get_credit_lines(
self, line_ids, partner_id, level_id, currency_id, company_id
):
""" Return credit lines related to a partner and a policy level """
"""Return credit lines related to a partner and a policy level"""
cr_line_obj = self.env["credit.control.line"]
cr_lines = cr_line_obj.search(
[
Expand Down Expand Up @@ -174,7 +174,7 @@ def _generate_comm_from_credit_lines(self, lines):
return comms

def _generate_emails(self):
""" Generate email message using template related to level """
"""Generate email message using template related to level"""
for comm in self:
comm.message_post_with_template(
comm.policy_level_id.email_template_id.id,
Expand Down
2 changes: 1 addition & 1 deletion account_credit_control/models/credit_control_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _compute_partner_user_id(self):
def _prepare_from_move_line(
self, move_line, level, controlling_date, open_amount, default_lines_vals
):
""" Create credit control line """
"""Create credit control line"""
channel = level.channel
partner = move_line.partner_id
# Fallback to letter
Expand Down
12 changes: 6 additions & 6 deletions account_credit_control/models/credit_control_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class CreditControlPolicy(models.Model):
""" Define a policy of reminder """
"""Define a policy of reminder"""

_name = "credit.control.policy"
_description = """Define a reminder policy"""
Expand All @@ -34,7 +34,7 @@ class CreditControlPolicy(models.Model):
active = fields.Boolean(default=True)

def _move_lines_domain(self, credit_control_run):
""" Build the default domain for searching move lines """
"""Build the default domain for searching move lines"""
self.ensure_one()
# We need to set the company in order to work properly with multi-companies.
# If we have Company A and Company B (child of A), we might be able to run this
Expand Down Expand Up @@ -166,7 +166,7 @@ def _lines_different_policy(self, lines):
return different_lines

def check_policy_against_account(self, account):
""" Ensure that the policy corresponds to account relation """
"""Ensure that the policy corresponds to account relation"""
allowed = self.search(
["|", ("account_ids", "in", account.ids), ("do_nothing", "=", True)]
)
Expand Down Expand Up @@ -331,7 +331,7 @@ def _get_sql_date_boundary_for_computation_mode(self):
)

def _get_sql_level_part(self):
""" Return a where clauses statement for the previous line level """
"""Return a where clauses statement for the previous line level"""
self.ensure_one()
previous_level = self._previous_level()
if previous_level:
Expand All @@ -340,7 +340,7 @@ def _get_sql_level_part(self):
return "cr_line.id IS NULL"

def _get_level_move_lines(self, controlling_date, lines):
""" Retrieve the move lines for all levels. """
"""Retrieve the move lines for all levels."""
self.ensure_one()
move_line_obj = self.env["account.move.line"]
if not lines:
Expand Down Expand Up @@ -379,7 +379,7 @@ def _get_level_move_lines(self, controlling_date, lines):
return move_line_obj

def get_level_lines(self, controlling_date, lines):
""" get all move lines in entry lines that match the current level """
"""get all move lines in entry lines that match the current level"""
self.ensure_one()
matching_lines = self.env["account.move.line"]
matching_lines |= self._get_level_move_lines(controlling_date, lines)
Expand Down
6 changes: 3 additions & 3 deletions account_credit_control/models/credit_control_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class CreditControlRun(models.Model):
""" Credit Control run generate all credit control lines and reject """
"""Credit Control run generate all credit control lines and reject"""

_name = "credit.control.run"
_rec_name = "date"
Expand Down Expand Up @@ -114,7 +114,7 @@ def _check_run_date(self, controlling_date):
)

def _generate_credit_lines(self):
""" Generate credit control lines. """
"""Generate credit control lines."""
self.ensure_one()
manually_managed_lines = self.env["account.move.line"]
self._check_run_date(self.date)
Expand Down Expand Up @@ -188,7 +188,7 @@ def open_credit_communications(self):
return action

def open_credit_lines(self):
""" Open the generated lines """
"""Open the generated lines"""
self.ensure_one()
action_name = "account_credit_control.credit_control_line_action"
action = self.env.ref(action_name)
Expand Down
2 changes: 1 addition & 1 deletion account_credit_control/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class ResCompany(models.Model):
""" Add credit control parameters """
"""Add credit control parameters"""

_inherit = "res.company"

Expand Down
2 changes: 1 addition & 1 deletion account_credit_control/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _compute_credit_control_count(self):

@api.constrains("credit_policy_id", "property_account_receivable_id")
def _check_credit_policy(self):
""" Ensure that policy on partner are limited to the account policy """
"""Ensure that policy on partner are limited to the account policy"""
# sudo needed for those w/o permission that duplicate records
for partner in self:
if (
Expand Down
4 changes: 2 additions & 2 deletions account_credit_control/wizard/credit_control_emailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class CreditControlEmailer(models.TransientModel):
""" Send emails for each selected credit control lines. """
"""Send emails for each selected credit control lines."""

_name = "credit.control.emailer"
_description = """Mass credit line emailer"""
Expand All @@ -34,7 +34,7 @@ def _get_line_ids(self):

@api.model
def _filter_lines(self, lines):
""" filter lines to use in the wizard """
"""filter lines to use in the wizard"""
line_obj = self.env["credit.control.line"]
domain = [
("state", "=", "to_be_sent"),
Expand Down
6 changes: 3 additions & 3 deletions account_credit_control/wizard/credit_control_marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class CreditControlMarker(models.TransientModel):
""" Change the state of lines in mass """
"""Change the state of lines in mass"""

_name = "credit.control.marker"
_description = "Mass marker"
Expand Down Expand Up @@ -44,14 +44,14 @@ def _default_lines(self):

@api.model
def _filter_lines(self, lines):
""" get line to be marked filter done lines """
"""get line to be marked filter done lines"""
line_obj = self.env["credit.control.line"]
domain = [("state", "!=", "sent"), ("id", "in", lines.ids)]
return line_obj.search(domain)

@api.model
def _mark_lines(self, filtered_lines, state):
""" write hook """
"""write hook"""
assert state
filtered_lines.write({"state": state})
return filtered_lines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _mark_as_overridden(self, move_lines):

@api.model
def _set_invoice_policy(self, move_lines, policy):
""" Force policy on invoice """
"""Force policy on invoice"""
invoices = move_lines.mapped("move_id")
invoices.write({"credit_policy_id": policy.id})

Expand Down
2 changes: 1 addition & 1 deletion account_credit_control/wizard/credit_control_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class CreditControlPrinter(models.TransientModel):
""" Print lines """
"""Print lines"""

_name = "credit.control.printer"
_rec_name = "id"
Expand Down
2 changes: 1 addition & 1 deletion account_financial_risk/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _get_risk_company_domain(self):
return [("company_id", "in", self.env.companies.ids)]

def _get_field_risk_model_domain(self, field_name):
""" Returns a tuple with model name and domain"""
"""Returns a tuple with model name and domain"""
risk_account_groups = self._risk_account_groups()
if field_name == "risk_invoice_draft":
domain = risk_account_groups["draft"]["domain"]
Expand Down

0 comments on commit 3b955f8

Please sign in to comment.