Fix pep8 and pyflakes
This commit is contained in:
1 parent
c8be246f07
commit
f52e121b00
4 files changed
+15
-10
No files matched your search
+1
-1
@@ -11,7 +11,7 @@
|
||||
'website': 'http://www.tryton.org/',
|
||||
'description': '''Add continental stock accounting for real-time stock valuation.
|
||||
''',
|
||||
'description_ca_ES': '''Afegeix comptabilitat d'estocs continental per
|
||||
'description_ca_ES': '''Afegeix comptabilitat d'estocs continental per
|
||||
la valoració d'estocs en temps real.''',
|
||||
'description_de_DE': '''
|
||||
- Fügt die kontinentale Methode der Lagerbewertung in Echt-Zeit hinzu.
|
||||
|
||||
@@ -132,4 +132,3 @@ class Template(ModelSQL, ModelView):
|
||||
'account.account', 'Account Stock Lost and Found'), 'get_account')
|
||||
|
||||
Template()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#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 decimal import Decimal
|
||||
from trytond.model import Model, ModelView, ModelSQL, fields
|
||||
from trytond.model import Model, fields
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
class Move(ModelSQL, ModelView):
|
||||
class Move(Model):
|
||||
_name = 'stock.move'
|
||||
|
||||
account_move = fields.Many2One('account.move', 'Account Move',
|
||||
@@ -17,7 +17,8 @@ class Move(ModelSQL, ModelView):
|
||||
'''
|
||||
uom_obj = Pool().get('product.uom')
|
||||
currency_obj = Pool().get('currency.currency')
|
||||
assert type_.startswith('in_') or type_.startswith('out_'), 'wrong type'
|
||||
assert type_.startswith('in_') or type_.startswith('out_'), \
|
||||
'wrong type'
|
||||
|
||||
move_line = {
|
||||
'name': move.rec_name,
|
||||
@@ -115,7 +116,7 @@ class Move(ModelSQL, ModelView):
|
||||
if not type_:
|
||||
return
|
||||
assert not move.account_move, 'account move field not empty'
|
||||
if type_ == 'supplier_customer':
|
||||
if type_ == 'supplier_customer':
|
||||
account_move_lines = self._get_account_stock_move_lines(move,
|
||||
'in_supplier')
|
||||
account_move_lines.extend(self._get_account_stock_move_lines(move,
|
||||
@@ -126,7 +127,8 @@ class Move(ModelSQL, ModelView):
|
||||
account_move_lines.extend(self._get_account_stock_move_lines(move,
|
||||
'out_supplier'))
|
||||
else:
|
||||
account_move_lines = self._get_account_stock_move_lines(move, type_)
|
||||
account_move_lines = self._get_account_stock_move_lines(move,
|
||||
type_)
|
||||
|
||||
amount = Decimal('0.0')
|
||||
for line in account_move_lines:
|
||||
|
||||
@@ -2,7 +2,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.
|
||||
|
||||
import sys, os
|
||||
import sys
|
||||
import os
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
'..', '..', '..', '..', '..', 'trytond')))
|
||||
if os.path.isdir(DIR):
|
||||
@@ -35,6 +36,7 @@ class AccountStockContinentalTestCase(unittest.TestCase):
|
||||
'''
|
||||
test_depends()
|
||||
|
||||
|
||||
def doctest_dropdb(test):
|
||||
'''
|
||||
Remove sqlite memory database
|
||||
@@ -47,12 +49,14 @@ def doctest_dropdb(test):
|
||||
finally:
|
||||
cursor.close()
|
||||
|
||||
|
||||
def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
AccountStockContinentalTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_account_stock_continental.rst',
|
||||
setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
|
||||
suite.addTests(doctest.DocFileSuite(
|
||||
'scenario_account_stock_continental.rst',
|
||||
setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
|
||||
return suite
|
||||
|
||||
|
||||
Reference in new issue
Block a user