Fix flake8 errors and warnings
We add the flake8 configuration used so we ensure everyone uses the same. We remove the usage of __all__ for non public API. When possible, we rationalize the class name according to its __name__ and module. issue9082 review297061002
This commit is contained in:
+23
-23
@@ -2,35 +2,35 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.pool import Pool
|
||||
from .configuration import *
|
||||
from .bom import *
|
||||
from .product import *
|
||||
from .production import *
|
||||
from .stock import *
|
||||
from . import configuration
|
||||
from . import bom
|
||||
from . import product
|
||||
from . import production
|
||||
from . import stock
|
||||
from . import ir
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Configuration,
|
||||
ConfigurationProductionSequence,
|
||||
BOM,
|
||||
BOMInput,
|
||||
BOMOutput,
|
||||
BOMTree,
|
||||
OpenBOMTreeStart,
|
||||
OpenBOMTreeTree,
|
||||
Production,
|
||||
AssignFailed,
|
||||
Template,
|
||||
Product,
|
||||
ProductBom,
|
||||
ProductionLeadTime,
|
||||
Location,
|
||||
Move,
|
||||
configuration.Configuration,
|
||||
configuration.ConfigurationProductionSequence,
|
||||
bom.BOM,
|
||||
bom.BOMInput,
|
||||
bom.BOMOutput,
|
||||
bom.BOMTree,
|
||||
bom.OpenBOMTreeStart,
|
||||
bom.OpenBOMTreeTree,
|
||||
production.Production,
|
||||
production.AssignFailed,
|
||||
product.Template,
|
||||
product.Product,
|
||||
product.ProductBom,
|
||||
product.ProductionLeadTime,
|
||||
stock.Location,
|
||||
stock.Move,
|
||||
ir.Cron,
|
||||
module='production', type_='model')
|
||||
Pool.register(
|
||||
Assign,
|
||||
OpenBOMTree,
|
||||
production.Assign,
|
||||
bom.OpenBOMTree,
|
||||
module='production', type_='wizard')
|
||||
|
||||
@@ -7,10 +7,6 @@ from trytond.pyson import Eval
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
__all__ = ['BOM', 'BOMInput', 'BOMOutput', 'BOMTree', 'OpenBOMTreeStart',
|
||||
'OpenBOMTreeTree', 'OpenBOMTree']
|
||||
|
||||
|
||||
class BOM(DeactivableMixin, ModelSQL, ModelView):
|
||||
"Bill of Material"
|
||||
__name__ = 'production.bom'
|
||||
|
||||
@@ -8,8 +8,6 @@ from trytond.tools.multivalue import migrate_property
|
||||
from trytond.modules.company.model import (
|
||||
CompanyMultiValueMixin, CompanyValueMixin)
|
||||
|
||||
__all__ = ['Configuration', 'ConfigurationProductionSequence']
|
||||
|
||||
|
||||
class Configuration(
|
||||
ModelSingleton, ModelSQL, ModelView, CompanyMultiValueMixin):
|
||||
|
||||
+3
-4
@@ -7,8 +7,6 @@ from trytond.model.exceptions import RecursionError
|
||||
from trytond.pyson import Eval, Get, If, Bool
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Template', 'Product', 'ProductBom', 'ProductionLeadTime']
|
||||
|
||||
|
||||
class Template(metaclass=PoolMeta):
|
||||
__name__ = 'product.template'
|
||||
@@ -50,8 +48,9 @@ class Product(metaclass=PoolMeta):
|
||||
product = self
|
||||
for product_bom in self.boms:
|
||||
for input_ in product_bom.bom.inputs:
|
||||
if (input_.product == product or
|
||||
input_.product.check_bom_recursion(product=product)):
|
||||
if (input_.product == product
|
||||
or input_.product.check_bom_recursion(
|
||||
product=product)):
|
||||
raise RecursionError(
|
||||
gettext('production.msg_recursive_bom',
|
||||
product=product.rec_name))
|
||||
|
||||
@@ -79,8 +79,8 @@ setup(name=name,
|
||||
keywords='tryton production',
|
||||
package_dir={'trytond.modules.production': '.'},
|
||||
packages=(
|
||||
['trytond.modules.production'] +
|
||||
['trytond.modules.production.%s' % p for p in find_packages()]
|
||||
['trytond.modules.production']
|
||||
+ ['trytond.modules.production.%s' % p for p in find_packages()]
|
||||
),
|
||||
package_data={
|
||||
'trytond.modules.production': (info.get('xml', [])
|
||||
@@ -95,7 +95,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)',
|
||||
|
||||
Reference in New Issue
Block a user