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 8e6b903219..b180b19c44 100644 --- a/__init__.py +++ b/__init__.py @@ -2,17 +2,17 @@ # this repository contains the full copyright notices and license terms. from trytond.pool import Pool -from .product import * -from .stock import * +from . import product +from . import stock def register(): Pool.register( - Template, - Product, - Configuration, - ConfigurationLotShelfLife, - Lot, - Move, - Period, + product.Template, + product.Product, + stock.Configuration, + stock.ConfigurationLotShelfLife, + stock.Lot, + stock.Move, + stock.Period, module='stock_lot_sled', type_='model') diff --git a/product.py b/product.py index db8cc28503..bb516bc7d0 100644 --- a/product.py +++ b/product.py @@ -6,8 +6,6 @@ from trytond.pyson import Eval from .stock import DATE_STATE -__all__ = ['Template', 'Product'] - class Template(metaclass=PoolMeta): __name__ = 'product.template' diff --git a/setup.py b/setup.py index 630595b743..a0036b52c2 100755 --- a/setup.py +++ b/setup.py @@ -78,8 +78,8 @@ setup(name=name, keywords='tryton stock lot', package_dir={'trytond.modules.stock_lot_sled': '.'}, packages=( - ['trytond.modules.stock_lot_sled'] + - ['trytond.modules.stock_lot_sled.%s' % p for p in find_packages()] + ['trytond.modules.stock_lot_sled'] + + ['trytond.modules.stock_lot_sled.%s' % p for p in find_packages()] ), package_data={ 'trytond.modules.stock_lot_sled': (info.get('xml', []) @@ -93,7 +93,8 @@ setup(name=name, 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Legal Industry', 'Intended Audience :: Manufacturing', - '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)', diff --git a/stock.py b/stock.py index 03d90d10b9..b8146e3759 100644 --- a/stock.py +++ b/stock.py @@ -16,9 +16,6 @@ from trytond.tools import grouped_slice from trytond.modules.stock.exceptions import PeriodCloseError from .exceptions import LotExpiredError, LotExpiredWarning -__all__ = ['Configuration', 'ConfigurationLotShelfLife', - 'Lot', 'Move', 'Period'] - DATE_STATE = [ ('none', 'None'), ('optional', 'Optional'), @@ -327,10 +324,10 @@ class Move(metaclass=PoolMeta): if add_join(sub_query.from_, lot): # only lot expiring during the period clause = ( - (lot.shelf_life_expiration_date >= - stock_date_start) - & (lot.shelf_life_expiration_date < - stock_date_end)) + (lot.shelf_life_expiration_date + >= stock_date_start) + & (lot.shelf_life_expiration_date + < stock_date_end)) if sub_query.where: sub_query.where &= clause else: