diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000..e1c6495da9 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +multi_line_output=4 +known_first_party=trytond diff --git a/__init__.py b/__init__.py index 9bfe4aade6..8820932def 100644 --- a/__init__.py +++ b/__init__.py @@ -1,11 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of this # repository contains the full copyright notices and license terms. from trytond.pool import Pool -from . import asset -from . import product -from . import invoice -from . import account -from . import purchase + +from . import account, asset, invoice, product, purchase def register(): diff --git a/account.py b/account.py index 90dd640014..8888b16a63 100644 --- a/account.py +++ b/account.py @@ -4,10 +4,10 @@ from trytond import backend from trytond.i18n import gettext from trytond.model import ModelSQL, fields from trytond.model.exceptions import AccessError -from trytond.pyson import Eval, If, Bool, Id -from trytond.pool import PoolMeta, Pool -from trytond.tools.multivalue import migrate_property from trytond.modules.company.model import CompanyValueMixin +from trytond.pool import Pool, PoolMeta +from trytond.pyson import Bool, Eval, Id, If +from trytond.tools.multivalue import migrate_property asset_bymonthday = fields.Selection([ ('1', "First"), diff --git a/asset.py b/asset.py index 2e42483562..7a1666ba35 100644 --- a/asset.py +++ b/asset.py @@ -1,24 +1,23 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of this # repository contains the full copyright notices and license terms. -import datetime import calendar +import datetime from decimal import Decimal -from dateutil import relativedelta -from dateutil import rrule from itertools import groupby +from dateutil import relativedelta, rrule + from trytond.i18n import gettext -from trytond.model import Workflow, ModelSQL, ModelView, fields, Unique +from trytond.model import ModelSQL, ModelView, Unique, Workflow, fields from trytond.model.exceptions import AccessError -from trytond.pyson import Eval, Bool, If -from trytond.pool import Pool -from trytond.tools import cached_property -from trytond.transaction import Transaction -from trytond.wizard import (Wizard, StateView, StateTransition, StateReport, - Button) -from trytond.tools import grouped_slice from trytond.modules.company import CompanyReport from trytond.modules.currency.fields import Monetary +from trytond.pool import Pool +from trytond.pyson import Bool, Eval, If +from trytond.tools import cached_property, grouped_slice +from trytond.transaction import Transaction +from trytond.wizard import ( + Button, StateReport, StateTransition, StateView, Wizard) from .exceptions import PrintDepreciationTableError diff --git a/invoice.py b/invoice.py index c84efea532..abb0daac65 100644 --- a/invoice.py +++ b/invoice.py @@ -1,8 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of this # repository contains the full copyright notices and license terms. -from trytond.model import fields, Unique -from trytond.pyson import Eval +from trytond.model import Unique, fields from trytond.pool import Pool, PoolMeta +from trytond.pyson import Eval from trytond.transaction import Transaction diff --git a/product.py b/product.py index 70c0978274..96a412f9ba 100644 --- a/product.py +++ b/product.py @@ -2,10 +2,10 @@ # repository contains the full copyright notices and license terms. from trytond import backend from trytond.model import fields -from trytond.pyson import Eval -from trytond.pool import PoolMeta, Pool from trytond.modules.account_product.product import ( account_used, template_property) +from trytond.pool import Pool, PoolMeta +from trytond.pyson import Eval class Category(metaclass=PoolMeta): diff --git a/purchase.py b/purchase.py index cb2749820d..affe9ec63c 100644 --- a/purchase.py +++ b/purchase.py @@ -1,9 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of this # repository contains the full copyright notices and license terms. from trytond.i18n import gettext -from trytond.pool import PoolMeta - from trytond.modules.account_product.exceptions import AccountError +from trytond.pool import PoolMeta class Line(metaclass=PoolMeta): diff --git a/setup.py b/setup.py index ada9366885..bdf4005054 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,8 @@ import io import os import re from configparser import ConfigParser -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): diff --git a/tests/test_account_asset.py b/tests/test_account_asset.py index 63e3758d69..bd766ba828 100644 --- a/tests/test_account_asset.py +++ b/tests/test_account_asset.py @@ -1,14 +1,13 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import datetime as dt -import unittest import doctest -import trytond.tests.test_tryton -from trytond.tests.test_tryton import ModuleTestCase -from trytond.tests.test_tryton import doctest_teardown -from trytond.tests.test_tryton import doctest_checker +import unittest +import trytond.tests.test_tryton from trytond.modules.account_asset.asset import normalized_delta +from trytond.tests.test_tryton import ( + ModuleTestCase, doctest_checker, doctest_teardown) class AccountAssetTestCase(ModuleTestCase):