Fix flake8
This commit is contained in:
1 parent
2b4acc3e16
commit
b5cd18b0ea
2 files changed
+24
-24
No files matched your search
+19
-19
@@ -66,10 +66,10 @@ class Forecast(Workflow, ModelSQL, ModelView):
|
||||
('check_date_overlap', 'date_overlap'),
|
||||
]
|
||||
cls._error_messages.update({
|
||||
'date_overlap': 'You can not create forecasts for the same ' \
|
||||
'locations with overlapping dates',
|
||||
'delete_cancel': 'Forecast "%s" must be cancelled before '\
|
||||
'deletion!',
|
||||
'date_overlap': ('You can not create forecasts for the same '
|
||||
'locations with overlapping dates'),
|
||||
'delete_cancel': ('Forecast "%s" must be cancelled before '
|
||||
'deletion!'),
|
||||
})
|
||||
cls._order.insert(0, ('from_date', 'DESC'))
|
||||
cls._order.insert(1, ('warehouse', 'ASC'))
|
||||
@@ -156,21 +156,21 @@ class Forecast(Workflow, ModelSQL, ModelView):
|
||||
cursor = Transaction().cursor
|
||||
if self.state != 'done':
|
||||
return True
|
||||
cursor.execute('SELECT id ' \
|
||||
'FROM stock_forecast ' \
|
||||
'WHERE ((from_date <= %s AND to_date >= %s) ' \
|
||||
'OR (from_date <= %s AND to_date >= %s) ' \
|
||||
'OR (from_date >= %s AND to_date <= %s)) ' \
|
||||
'AND warehouse = %s ' \
|
||||
'AND destination = %s ' \
|
||||
'AND state = \'done\' ' \
|
||||
'AND company = %s '
|
||||
'AND id != %s',
|
||||
(self.from_date, self.from_date,
|
||||
self.to_date, self.to_date,
|
||||
self.from_date, self.to_date,
|
||||
self.warehouse.id, self.destination.id,
|
||||
self.company.id, self.id))
|
||||
cursor.execute('SELECT id '
|
||||
'FROM stock_forecast '
|
||||
'WHERE ((from_date <= %s AND to_date >= %s) '
|
||||
'OR (from_date <= %s AND to_date >= %s) '
|
||||
'OR (from_date >= %s AND to_date <= %s)) '
|
||||
'AND warehouse = %s '
|
||||
'AND destination = %s '
|
||||
'AND state = \'done\' '
|
||||
'AND company = %s '
|
||||
'AND id != %s',
|
||||
(self.from_date, self.from_date,
|
||||
self.to_date, self.to_date,
|
||||
self.from_date, self.to_date,
|
||||
self.warehouse.id, self.destination.id,
|
||||
self.company.id, self.id))
|
||||
rowcount = cursor.rowcount
|
||||
if rowcount == -1 or rowcount is None:
|
||||
rowcount = len(cursor.fetchall())
|
||||
|
||||
@@ -25,10 +25,10 @@ requires = ['python-dateutil']
|
||||
for dep in info.get('depends', []):
|
||||
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
||||
requires.append('trytond_%s >= %s.%s, < %s.%s' %
|
||||
(dep, major_version, minor_version, major_version,
|
||||
minor_version + 1))
|
||||
(dep, major_version, minor_version, major_version,
|
||||
minor_version + 1))
|
||||
requires.append('trytond >= %s.%s, < %s.%s' %
|
||||
(major_version, minor_version, major_version, minor_version + 1))
|
||||
(major_version, minor_version, major_version, minor_version + 1))
|
||||
|
||||
setup(name='trytond_stock_forecast',
|
||||
version=info.get('version', '0.0.1'),
|
||||
@@ -44,8 +44,8 @@ setup(name='trytond_stock_forecast',
|
||||
'trytond.modules.stock_forecast.tests',
|
||||
],
|
||||
package_data={
|
||||
'trytond.modules.stock_forecast': info.get('xml', []) \
|
||||
+ ['tryton.cfg', 'locale/*.po'],
|
||||
'trytond.modules.stock_forecast': (info.get('xml', [])
|
||||
+ ['tryton.cfg', 'locale/*.po']),
|
||||
},
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
|
||||
Reference in new issue
Block a user