diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000000..bb03d08a82 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore=E123,E124,E126,E128,W503 diff --git a/__init__.py b/__init__.py index fa3c51a2ad..6d428c03e9 100644 --- a/__init__.py +++ b/__init__.py @@ -33,7 +33,7 @@ def register(): account.Journal, module='account_asset', type_='model') Pool.register( - purchase.PurchaseLine, + purchase.Line, module='account_asset', type_='model', depends=['purchase']) Pool.register( asset.CreateMoves, diff --git a/asset.py b/asset.py index a591bf7c11..e2dee1af9e 100644 --- a/asset.py +++ b/asset.py @@ -19,12 +19,6 @@ from trytond.wizard import (Wizard, StateView, StateTransition, StateReport, from trytond.tools import grouped_slice from trytond.modules.company import CompanyReport -__all__ = ['Asset', 'AssetLine', 'AssetUpdateMove', - 'CreateMovesStart', 'CreateMoves', - 'UpdateAssetStart', 'UpdateAssetShowDepreciation', 'UpdateAsset', - 'AssetDepreciationTable', - 'PrintDepreciationTableStart', 'PrintDepreciationTable'] - def date2datetime(date): return datetime.datetime.combine(date, datetime.time()) @@ -67,7 +61,7 @@ class Asset(Workflow, ModelSQL, ModelView): supplier_invoice_line = fields.Many2One('account.invoice.line', 'Supplier Invoice Line', domain=[ - If(Eval('product', None) == None, + If(~Eval('product', None), ('product', '=', -1), ('product', '=', Eval('product', -1)), ), @@ -991,8 +985,9 @@ class AssetDepreciationTable(CompanyReport): @cached_property def update_lines(self): - filter_ = lambda l: (l.account.type.expense - and self.start_date < l.move.date <= self.end_date) + def filter_(l): + return (l.account.type.expense + and self.start_date < l.move.date <= self.end_date) return list(filter(filter_, (l for m in self.asset.update_moves for l in m.lines))) diff --git a/invoice.py b/invoice.py index c80c430a39..9e56da4120 100644 --- a/invoice.py +++ b/invoice.py @@ -5,8 +5,6 @@ from trytond.pyson import Eval from trytond.pool import Pool, PoolMeta from trytond.transaction import Transaction -__all__ = ['InvoiceLine'] - class InvoiceLine(metaclass=PoolMeta): __name__ = 'account.invoice.line' diff --git a/product.py b/product.py index 89a347f939..10321da4ef 100644 --- a/product.py +++ b/product.py @@ -7,8 +7,6 @@ from trytond.pool import PoolMeta, Pool from trytond.modules.account_product.product import ( account_used, template_property) -__all__ = ['Category', 'CategoryAccount', 'Template', 'Product'] - class Category(metaclass=PoolMeta): __name__ = 'product.category' diff --git a/purchase.py b/purchase.py index e8ad61255b..cb2749820d 100644 --- a/purchase.py +++ b/purchase.py @@ -5,14 +5,12 @@ from trytond.pool import PoolMeta from trytond.modules.account_product.exceptions import AccountError -__all__ = ['PurchaseLine'] - -class PurchaseLine(metaclass=PoolMeta): +class Line(metaclass=PoolMeta): __name__ = 'purchase.line' def get_invoice_line(self): - invoice_lines = super(PurchaseLine, self).get_invoice_line() + invoice_lines = super().get_invoice_line() if (self.product and self.product.type == 'assets' and self.product.depreciable): diff --git a/setup.py b/setup.py index 14f25606c7..7a0670d04b 100755 --- a/setup.py +++ b/setup.py @@ -81,8 +81,8 @@ setup(name=name, keywords='tryton account asset', package_dir={'trytond.modules.account_asset': '.'}, packages=( - ['trytond.modules.account_asset'] + - ['trytond.modules.account_asset.%s' % p for p in find_packages()] + ['trytond.modules.account_asset'] + + ['trytond.modules.account_asset.%s' % p for p in find_packages()] ), package_data={ 'trytond.modules.account_asset': (info.get('xml', []) @@ -96,7 +96,8 @@ setup(name=name, 'Intended Audience :: Developers', 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'License :: OSI Approved :: ' + 'GNU General Public License v3 or later (GPLv3+)', 'Natural Language :: Bulgarian', 'Natural Language :: Catalan', 'Natural Language :: Chinese (Simplified)',