Fix flake8
This commit is contained in:
1 parent
081924b014
commit
68eb13ed88
4 files changed
+15
-10
No files matched your search
+2
-1
@@ -97,7 +97,8 @@ class Location(ModelSQL, ModelView):
|
||||
cls._order.insert(0, ('name', 'ASC'))
|
||||
cls._error_messages.update({
|
||||
'invalid_type_for_moves': ('Location "%s" with existing moves '
|
||||
'cannot be changed to a type that does not support moves.'),
|
||||
'cannot be changed to a type that does not support moves.'
|
||||
),
|
||||
'child_of_warehouse': ('Location "%(location)s" must be a '
|
||||
'child of warehouse "%(warehouse)s".'),
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import datetime
|
||||
import operator
|
||||
from decimal import Decimal
|
||||
from functools import reduce, partial
|
||||
from functools import partial
|
||||
from sql import Column
|
||||
from sql.operators import Concat
|
||||
|
||||
@@ -447,9 +447,9 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
|
||||
@classmethod
|
||||
def get_shipment(cls):
|
||||
Model = Pool().get('ir.model')
|
||||
IrModel = Pool().get('ir.model')
|
||||
models = cls._get_shipment()
|
||||
models = Model.search([
|
||||
models = IrModel.search([
|
||||
('model', 'in', models),
|
||||
])
|
||||
return [(None, '')] + [(m.model, m.name) for m in models]
|
||||
@@ -461,9 +461,9 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
|
||||
@classmethod
|
||||
def get_origin(cls):
|
||||
Model = Pool().get('ir.model')
|
||||
IrModel = Pool().get('ir.model')
|
||||
models = cls._get_origin()
|
||||
models = Model.search([
|
||||
models = IrModel.search([
|
||||
('model', 'in', models),
|
||||
])
|
||||
return [(None, '')] + [(m.model, m.name) for m in models]
|
||||
|
||||
@@ -34,7 +34,8 @@ class Period(Workflow, ModelSQL, ModelView):
|
||||
cls._error_messages.update({
|
||||
'close_period_future_today': ('You can not close a period '
|
||||
'in the future or today.'),
|
||||
'close_period_assigned_move': ('You can not close a period when '
|
||||
'close_period_assigned_move': (
|
||||
'You can not close a period when '
|
||||
'there still are assigned moves.'),
|
||||
})
|
||||
cls._transitions |= set((
|
||||
@@ -68,13 +69,14 @@ class Period(Workflow, ModelSQL, ModelView):
|
||||
@ModelView.button
|
||||
@Workflow.transition('draft')
|
||||
def draft(cls, periods):
|
||||
in_max = Transaction().cursor.IN_MAX
|
||||
for grouping in cls.groupings():
|
||||
Cache = cls.get_cache(grouping)
|
||||
caches = []
|
||||
for i in xrange(0, len(periods), Transaction().cursor.IN_MAX):
|
||||
for i in xrange(0, len(periods), in_max):
|
||||
caches.append(Cache.search([
|
||||
('period', 'in', [p.id for p in
|
||||
periods[i:i + Transaction().cursor.IN_MAX]]),
|
||||
('period', 'in',
|
||||
[p.id for p in periods[i:i + in_max]]),
|
||||
], order=[]))
|
||||
Cache.delete(list(chain(*caches)))
|
||||
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
|
||||
from .test_stock import suite
|
||||
|
||||
__all__ = ['suite']
|
||||
Reference in new issue
Block a user