From 994bd8a1035a886b72d8c404fbb6a9a1bc2fbe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 2 Dec 2014 12:56:04 +0100 Subject: [PATCH] Fix most flake8 errors review8771002 --- __init__.py | 4 ++-- configuration.py | 6 +++--- inventory.py | 4 ++-- location.py | 4 ++-- move.py | 7 ++++--- period.py | 6 +++--- product.py | 4 ++-- setup.py | 4 ++-- shipment.py | 9 +++++---- tests/__init__.py | 4 ++-- tests/test_stock.py | 4 ++-- 11 files changed, 29 insertions(+), 27 deletions(-) diff --git a/__init__.py b/__init__.py index 53d577ca3a..518f59012a 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this -#repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from trytond.pool import Pool from .location import * diff --git a/configuration.py b/configuration.py index c62473b925..c0e1b42230 100644 --- a/configuration.py +++ b/configuration.py @@ -1,7 +1,7 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, ModelSingleton, fields -from trytond.pyson import Eval, Get +from trytond.pyson import Eval __all__ = ['Configuration'] diff --git a/inventory.py b/inventory.py index 6d1277ddef..37289fceba 100644 --- a/inventory.py +++ b/inventory.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level -#of this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from sql import Null from trytond.model import Workflow, ModelView, ModelSQL, fields diff --git a/location.py b/location.py index e4df3babcb..fcdc590cc9 100644 --- a/location.py +++ b/location.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. import datetime from decimal import Decimal from trytond.model import ModelView, ModelSQL, fields diff --git a/move.py b/move.py index 5c90c257c3..52da9f3d88 100644 --- a/move.py +++ b/move.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. import datetime import operator from decimal import Decimal @@ -224,7 +224,8 @@ class Move(Workflow, ModelSQL, ModelView): 'readonly': Not(Equal(Eval('state'), 'draft')), }, depends=['unit_price_required', 'state']) - unit_price_required = fields.Function(fields.Boolean('Unit Price Required'), + unit_price_required = fields.Function( + fields.Boolean('Unit Price Required'), 'on_change_with_unit_price_required') @classmethod diff --git a/period.py b/period.py index e478e65a1c..6557c5a863 100644 --- a/period.py +++ b/period.py @@ -1,8 +1,8 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from itertools import chain from trytond.model import Workflow, ModelView, ModelSQL, fields -from trytond.pyson import Equal, Eval, If, In, Get +from trytond.pyson import Equal, Eval, If, In from trytond.transaction import Transaction from trytond.pool import Pool from trytond.tools import grouped_slice diff --git a/product.py b/product.py index 67c166cceb..98d80253c3 100644 --- a/product.py +++ b/product.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. import datetime from decimal import Decimal diff --git a/setup.py b/setup.py index d89c2aa29f..3a65a7c0c9 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from setuptools import setup import re diff --git a/shipment.py b/shipment.py index 4df1a45b51..91273a9415 100644 --- a/shipment.py +++ b/shipment.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. import operator import itertools import datetime @@ -12,7 +12,7 @@ from trytond.model import Workflow, ModelView, ModelSQL, fields from trytond.modules.company import CompanyReport from trytond.wizard import Wizard, StateTransition, StateView, Button from trytond import backend -from trytond.pyson import Eval, Not, Equal, If, Or, And, Bool, In, Get, Id +from trytond.pyson import Eval, Not, Equal, If, Or, And, Bool, In, Id from trytond.transaction import Transaction from trytond.pool import Pool, PoolMeta from trytond.tools import reduce_ids, grouped_slice @@ -1033,6 +1033,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView): def get_origins(self, name): return ', '.join(set(itertools.ifilter(None, (m.origin_name for m in self.moves)))) + @classmethod @ModelView.button @Workflow.transition('draft') @@ -1160,7 +1161,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView): if to_create: Move.save(to_create) - #Re-read the shipment and remove exceeding quantities + # Re-read the shipment and remove exceeding quantities for move in shipment.outgoing_moves: if move.state == 'cancel': continue diff --git a/tests/__init__.py b/tests/__init__.py index 2349560ca6..aa4b1e35e3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from .test_stock import suite diff --git a/tests/test_stock.py b/tests/test_stock.py index 950b128cca..5c6cbcd17e 100644 --- a/tests/test_stock.py +++ b/tests/test_stock.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. import unittest import doctest import datetime