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:
Cédric Krier committed 2020-03-01 12:33:53 +01:00
1 parent e1e0a4a470
commit 5a5e9c9a06
4 files changed
+7 -11

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
[flake8]
ignore=E123,E124,E126,E128,W503
+2 -8
View File
@@ -17,13 +17,6 @@ from trytond.wizard import Wizard, StateView, StateTransition, Button
from .exceptions import PreviousQuotation
__all__ = ['Configuration', 'ConfigurationSequence', 'Quotation',
'QuotationLine', 'CreatePurchaseRequestQuotationAskSuppliers',
'CreatePurchaseRequestQuotationSucceed', 'PurchaseRequest',
'CreatePurchaseRequestQuotation', 'CreatePurchase',
'PurchaseRequestQuotationReport']
def process_request(func):
@wraps(func)
def wrapper(cls, quotations):
@@ -625,7 +618,8 @@ class CreatePurchase(Wizard):
to_save = []
requests = Request.browse(Transaction().context['active_ids'])
reqs = [r for r in requests if not r.purchase_line and r.quotation_lines]
reqs = [r for r in requests
if not r.purchase_line and r.quotation_lines]
to_save = []
for req in reqs:
if req.best_quotation_line:
+2 -2
View File
@@ -83,8 +83,8 @@ setup(name=name,
keywords='tryton purchase request for quotation',
package_dir={'trytond.modules.purchase_request_quotation': '.'},
packages=(
['trytond.modules.purchase_request_quotation'] +
['trytond.modules.purchase_request_quotation.%s' % p
['trytond.modules.purchase_request_quotation']
+ ['trytond.modules.purchase_request_quotation.%s' % p
for p in find_packages()]
),
package_data={
+1 -1
View File
@@ -3,7 +3,7 @@
# the full copyright notices and license terms.
try:
from trytond.modules.purchase_request_quotation.tests.test_purchase_request_quotation import suite
from trytond.modules.purchase_request_quotation.tests.test_purchase_request_quotation import suite # noqa: E501
except ImportError:
from .test_purchase_request_quotation import suite