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 31, 2022
1 parent 80a62e2 commit 7f22fc6
Show file tree
Hide file tree
Showing 19 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,11 +1,13 @@
# 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:
- purchase_cancel_reason
- purchase_cancel_confirm
Expand All @@ -14,5 +16,6 @@ rebel_module_groups:
repo_description: 'TODO: add repo description.'
repo_name: purchase-workflow
repo_slug: purchase-workflow
repo_website: https://github.com/OCA/purchase-workflow
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/[email protected]
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/142/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-purchase-workflow-142)

[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=14.0)
[![Build Status](https://travis-ci.com/OCA/purchase-workflow.svg?branch=14.0)](https://travis-ci.com/OCA/purchase-workflow)
[![codecov](https://codecov.io/gh/OCA/purchase-workflow/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/purchase-workflow)
[![Translation Status](https://translation.odoo-community.org/widgets/purchase-workflow-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/purchase-workflow-14-0/?utm_source=widget)
Expand Down Expand Up @@ -86,12 +87,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 purchase_cancel_reason/wizard/purchase_cancel_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PurchaseOrderCancel(models.TransientModel):

""" Ask a reason for the purchase order cancellation."""
"""Ask a reason for the purchase order cancellation."""

_name = "purchase.order.cancel"
_description = __doc__
Expand Down
2 changes: 1 addition & 1 deletion purchase_discount/models/product_supplierinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProductSupplierInfo(models.Model):

@api.onchange("name")
def onchange_name(self):
""" Apply the default supplier discount of the selected supplier """
"""Apply the default supplier discount of the selected supplier"""
for supplierinfo in self.filtered("name"):
supplierinfo.discount = supplierinfo.name.default_supplierinfo_discount

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_005_default_supplierinfo_discount(self):
)

def test_006_supplierinfo_from_purchaseorder(self):
""" Include discount when creating new sellers for a product """
"""Include discount when creating new sellers for a product"""
partner = self.env.ref("base.res_partner_3")
product = self.env.ref("product.product_product_8")
self.assertFalse(
Expand Down
2 changes: 1 addition & 1 deletion purchase_invoice_plan/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _compute_new_invoice_quantity(self, invoice_move):
move._move_autocomplete_invoice_lines_values() # recompute dr/cr

def _update_new_quantity(self, line, percent):
""" Hook function """
"""Hook function"""
plan_qty = self._get_plan_qty(line.purchase_line_id, percent)
prec = line.purchase_line_id.product_uom.rounding
if float_compare(abs(plan_qty), abs(line.quantity), prec) == 1:
Expand Down
4 changes: 2 additions & 2 deletions purchase_isolated_rfq/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def post_init_hook(cr, registry):
""" Set value for order_sequence on old records """
"""Set value for order_sequence on old records"""
cr.execute(
"""
update purchase_order
Expand All @@ -25,7 +25,7 @@ def post_init_hook(cr, registry):


def uninstall_hook(cr, registry):
""" Restore purchase.order action's domain/context """
"""Restore purchase.order action's domain/context"""
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
for action_id in ACTIONS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setUp(self):
)

def _create_user(self, login, groups, company):
""" Create a user."""
"""Create a user."""
group_ids = [group.id for group in groups]
user = self.users_obj.with_context({"no_reset_password": True}).create(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _create_block_reason(self):
)

def _create_user(self, login, groups, company):
""" Create a user."""
"""Create a user."""
group_ids = [group.id for group in groups]
user = self.users_obj.with_context({"no_reset_password": True}).create(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class ResConfigSettings(models.TransientModel):

@api.onchange("po_line_order_default")
def onchange_po_line_order_default(self):
""" Reset direction line order when user remove order field value """
"""Reset direction line order when user remove order field value"""
if not self.po_line_order_default:
self.po_line_direction_default = False
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_without_line_order(self):
self.assertEqual(self.po.order_line[2].product_id, self.product_3)

def test_line_by_name(self):
""" Test if lines are ordered by purchase line name"""
"""Test if lines are ordered by purchase line name"""
self.po.write({"line_order": "name", "line_direction": "asc"})
lines = self.po_line_model.search([("order_id", "=", self.po.id)])
self._check_value(lines, self.product_1, self.product_3)
Expand All @@ -77,7 +77,7 @@ def test_line_by_name(self):
self.assertEqual(lines[1].name, "Test 2")

def test_line_by_product_name(self):
""" Test if lines are ordered by product name"""
"""Test if lines are ordered by product name"""
self.po.write({"line_order": "product_id.name", "line_direction": "asc"})
lines = self.po_line_model.search([("order_id", "=", self.po.id)])
self._check_value(lines, self.product_1, self.product_3)
Expand All @@ -90,7 +90,7 @@ def test_line_by_product_name(self):
self.assertEqual(lines[1].product_id.name, "Test product 2")

def test_line_by_product_code(self):
""" Test if lines are ordered by product code"""
"""Test if lines are ordered by product code"""
self.po.write(
{"line_order": "product_id.default_code", "line_direction": "asc"}
)
Expand All @@ -103,7 +103,7 @@ def test_line_by_product_code(self):
self.assertEqual(lines[1].product_id.default_code, "BCD")

def test_line_by_date_planned(self):
""" Test if lines are ordered by purchase line date planned"""
"""Test if lines are ordered by purchase line date planned"""
self.po.write({"line_order": "date_planned", "line_direction": "asc"})
lines = self.po_line_model.search([("order_id", "=", self.po.id)])
self._check_value(lines, self.product_1, self.product_2)
Expand All @@ -114,7 +114,7 @@ def test_line_by_date_planned(self):
self.assertEqual(fields.Date.to_string(lines[1].date_planned), "2018-11-03")

def test_line_by_price_unit(self):
""" Test if lines are ordered by purchase line price"""
"""Test if lines are ordered by purchase line price"""
self.po.write({"line_order": "price_unit", "line_direction": "asc"})
lines = self.po_line_model.search([("order_id", "=", self.po.id)])
self._check_value(lines, self.product_3, self.product_1)
Expand All @@ -125,7 +125,7 @@ def test_line_by_price_unit(self):
self.assertAlmostEqual(lines[1].price_unit, 6.0)

def test_line_by_product_qty(self):
""" Test if lines are ordered by purchase line product_qty"""
"""Test if lines are ordered by purchase line product_qty"""
self.po.write({"line_order": "product_qty", "line_direction": "asc"})
lines = self.po_line_model.search([("order_id", "=", self.po.id)])
self._check_value(lines, self.product_3, self.product_2)
Expand Down
4 changes: 2 additions & 2 deletions purchase_propagate_qty/tests/test_purchase_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_purchase_line_split_move_w_reserved_qty(self):
self.assertEqual(move2.product_uom_qty, 12.0)

def test_reduce_purchase_qty_with_canceled_moves(self):
""" Check canceled moves are not taken into account."""
"""Check canceled moves are not taken into account."""
self.po.button_cancel() # Cancel the moves
self.po.button_draft()
self.po.button_confirm()
Expand All @@ -169,7 +169,7 @@ def test_reduce_purchase_qty_with_canceled_moves(self):
self.assertEqual(move.product_uom_qty, 10)

def test_reduce_purchase_qty_with_done_moves(self):
""" Check canceled moves are not taken into account."""
"""Check canceled moves are not taken into account."""
self.po.button_draft()
self.po.button_confirm()
line1 = self.po.order_line[0]
Expand Down
2 changes: 1 addition & 1 deletion purchase_quick/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def search(self, args, offset=0, limit=None, order=None, count=False):

@api.model
def check_access_rights(self, operation, raise_exception=True):
""" hijack product edition rights if we're in the mass edition menu """
"""hijack product edition rights if we're in the mass edition menu"""
if self.env.context.get("quick_access_rights_purchase"):
return self.env["purchase.order.line"].check_access_rights(
operation, raise_exception
Expand Down
6 changes: 3 additions & 3 deletions purchase_triple_discount/tests/test_purchase_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def setUpClass(cls):
)

def test_01_purchase_order_classic_discount(self):
""" Tests with single discount """
"""Tests with single discount"""
self.po_line1.discount = 50.0
self.po_line2.discount = 75.0
self.assertEqual(self.po_line1.price_subtotal, 300.0)
Expand All @@ -121,7 +121,7 @@ def test_01_purchase_order_classic_discount(self):
self.assertEqual(self.order.amount_tax, 22.5)

def test_02_purchase_order_simple_triple_discount(self):
""" Tests on a single line """
"""Tests on a single line"""
self.po_line2.unlink()
# Divide by two on every discount:
self.po_line1.discount = 50.0
Expand All @@ -142,7 +142,7 @@ def test_02_purchase_order_simple_triple_discount(self):
self.assertEqual(self.order.amount_tax, 67.5)

def test_03_purchase_order_complex_triple_discount(self):
""" Tests on multiple lines """
"""Tests on multiple lines"""
self.po_line1.discount = 50.0
self.po_line1.discount2 = 50.0
self.po_line1.discount3 = 50.0
Expand Down
2 changes: 1 addition & 1 deletion purchase_work_acceptance/models/work_acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _unlink_zero_quantity(self):
wa_line_zero_quantity.unlink()

def _get_valid_wa(self, doctype, order_id):
""" Get unused WA when validate invoice or picking """
"""Get unused WA when validate invoice or picking"""
order = self.env["purchase.order"].browse(order_id)
all_wa = self.env["work.acceptance"].search(
[
Expand Down
2 changes: 1 addition & 1 deletion purchase_work_acceptance_late_fines/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _prepare_move_wa_late(self, wa):

@api.onchange("late_wa_id")
def _onchange_late_wa_id(self):
""" Auto fill values from WA delivery late fines """
"""Auto fill values from WA delivery late fines"""
MoveLine = self.env["account.move.line"]
if self.move_type == "out_invoice" and self.late_wa_id:
self.invoice_line_ids = False
Expand Down

0 comments on commit 7f22fc6

Please sign in to comment.