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:
1 parent
512ea13265
commit
48bcfbf6cd
7 files changed
+23
-26
No files matched your search
+15
-15
@@ -2,25 +2,25 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.pool import Pool
|
||||
from .dunning import *
|
||||
from .party import *
|
||||
from .account import *
|
||||
from . import dunning
|
||||
from . import party
|
||||
from . import account
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Procedure,
|
||||
Level,
|
||||
Dunning,
|
||||
CreateDunningStart,
|
||||
ProcessDunningStart,
|
||||
Party,
|
||||
PartyDunningProcedure,
|
||||
Configuration,
|
||||
ConfigurationDefaultDunningProcedure,
|
||||
MoveLine,
|
||||
dunning.Procedure,
|
||||
dunning.Level,
|
||||
dunning.Dunning,
|
||||
dunning.CreateDunningStart,
|
||||
dunning.ProcessDunningStart,
|
||||
party.Party,
|
||||
party.PartyDunningProcedure,
|
||||
account.Configuration,
|
||||
account.ConfigurationDefaultDunningProcedure,
|
||||
account.MoveLine,
|
||||
module='account_dunning', type_='model')
|
||||
Pool.register(
|
||||
CreateDunning,
|
||||
ProcessDunning,
|
||||
dunning.CreateDunning,
|
||||
dunning.ProcessDunning,
|
||||
module='account_dunning', type_='wizard')
|
||||
@@ -3,8 +3,6 @@
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.model import ModelSQL, ValueMixin, fields
|
||||
|
||||
|
||||
__all__ = ['Configuration', 'ConfigurationDefaultDunningProcedure', 'MoveLine']
|
||||
default_dunning_procedure = fields.Many2One(
|
||||
'account.dunning.procedure', "Default Dunning Procedure",
|
||||
help="The default dunning procedure for new customers.")
|
||||
|
||||
+1
-4
@@ -13,10 +13,6 @@ from trytond.wizard import Wizard, StateView, StateAction, StateTransition, \
|
||||
Button
|
||||
from trytond.pool import Pool
|
||||
|
||||
__all__ = ['Procedure', 'Level', 'Dunning',
|
||||
'CreateDunningStart', 'CreateDunning',
|
||||
'ProcessDunningStart', 'ProcessDunning']
|
||||
|
||||
|
||||
class Procedure(ModelSQL, ModelView):
|
||||
'Account Dunning Procedure'
|
||||
@@ -67,6 +63,7 @@ class Level(sequence_ordered(), ModelSQL, ModelView):
|
||||
if self.overdue is not None:
|
||||
return (date - line.maturity_date) >= self.overdue
|
||||
|
||||
|
||||
_STATES = {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ from trytond.model import ModelSQL, ValueMixin, fields
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.tools.multivalue import migrate_property
|
||||
|
||||
__all__ = ['Party', 'PartyDunningProcedure']
|
||||
dunning_procedure = fields.Many2One(
|
||||
'account.dunning.procedure', "Dunning Procedure")
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ setup(name=name,
|
||||
keywords='tryton account dunning',
|
||||
package_dir={'trytond.modules.account_dunning': '.'},
|
||||
packages=(
|
||||
['trytond.modules.account_dunning'] +
|
||||
['trytond.modules.account_dunning.%s' % p for p in find_packages()]
|
||||
['trytond.modules.account_dunning']
|
||||
+ ['trytond.modules.account_dunning.%s' % p for p in find_packages()]
|
||||
),
|
||||
package_data={
|
||||
'trytond.modules.account_dunning': (info.get('xml', [])
|
||||
@@ -93,7 +93,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)',
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
try:
|
||||
from trytond.modules.account_dunning.tests.test_account_dunning import suite
|
||||
from trytond.modules.account_dunning.tests.test_account_dunning import suite # noqa: E501
|
||||
except ImportError:
|
||||
from .test_account_dunning import suite
|
||||
|
||||
|
||||
Reference in new issue
Block a user