Fix pep8 and pyflakes

This commit is contained in:
Cédric Krier
2012-04-03 20:06:39 +02:00
parent 9e90e2207a
commit e6eb4e83c9
2 changed files with 9 additions and 5 deletions
+6 -4
View File
@@ -50,8 +50,8 @@ class PurchaseLine(ModelSQL, ModelView):
def _view_look_dom_arch(self, tree, type, field_children=None):
analytic_account_obj = Pool().get('analytic_account.account')
analytic_account_obj.convert_view(tree)
arch, fields = super(PurchaseLine, self)._view_look_dom_arch(tree, type,
field_children=field_children)
arch, fields = super(PurchaseLine, self)._view_look_dom_arch(tree,
type, field_children=field_children)
return arch, fields
def fields_get(self, fields_names=None):
@@ -214,7 +214,8 @@ class PurchaseLine(ModelSQL, ModelView):
return new_ids
def get_invoice_line(self, line):
account_selection_obj = Pool().get('analytic_account.account.selection')
pool = Pool()
account_selection_obj = pool.get('analytic_account.account.selection')
res = super(PurchaseLine, self).get_invoice_line(line)
if not res:
@@ -222,7 +223,8 @@ class PurchaseLine(ModelSQL, ModelView):
selection_id = False
if line.analytic_accounts:
selection_id = account_selection_obj.copy(line.analytic_accounts.id)
selection_id = account_selection_obj.copy(
line.analytic_accounts.id)
for vals in res:
vals['analytic_accounts'] = selection_id
return res
+3 -1
View File
@@ -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):
@@ -33,6 +34,7 @@ class AnalyticPurchaseTestCase(unittest.TestCase):
'''
test_depends()
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(