Fix pep8 and pyflakes

This commit is contained in:
Cédric Krier
2012-04-03 20:07:18 +02:00
parent 775423b5dd
commit bbe639d663
4 changed files with 13 additions and 10 deletions
+6 -7
View File
@@ -2,7 +2,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.
{
'name' : 'Product',
'name': 'Product',
'name_bg_BG': 'Продукт',
'name_ca_ES': 'Productes',
'name_de_DE': 'Artikel',
@@ -11,8 +11,8 @@
'name_fr_FR': 'Produit',
'name_nl_NL': 'Producten',
'name_ru_RU': 'ТМЦ',
'version' : '2.3.0',
'author' : 'B2CK',
'version': '2.3.0',
'author': 'B2CK',
'email': 'info@b2ck.com',
'website': 'http://www.tryton.org/',
'description': 'Define products, categories of product, units ' \
@@ -29,13 +29,13 @@ de mesura, categories d'unitats de mesura.''',
- Unité de mesure
- Catégorie d'unité de mesure
''',
'description_nl_NL': 'Definieert producten, productcategorieën, meeteenheden en categorieën van meeteenheden.',
'description_nl_NL': 'Definieert producten, productcategorieën, meeteenheden en categorieën van meeteenheden.',
'description_ru_RU': 'Определение ТМЦ, категорий ТМЦ, единиц измерения, категорий единиц измерения.',
'depends' : [
'depends': [
'ir',
'res',
],
'xml' : [
'xml': [
'product.xml',
'category.xml',
'uom.xml',
@@ -52,4 +52,3 @@ de mesura, categories d'unitats de mesura.''',
'locale/ru_RU.po',
]
}
+2 -1
View File
@@ -9,7 +9,7 @@ class Category(ModelSQL, ModelView):
_description = __doc__
name = fields.Char('Name', required=True, translate=True)
parent = fields.Many2One('product.category','Parent', select=True)
parent = fields.Many2One('product.category', 'Parent', select=True)
childs = fields.One2Many('product.category', 'parent',
string='Children')
@@ -28,6 +28,7 @@ class Category(ModelSQL, ModelView):
if not ids:
return {}
res = {}
def _name(category):
if category.id in res:
return res[category.id]
+4 -2
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):
@@ -15,6 +16,7 @@ from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
test_depends
from trytond.transaction import Transaction
class ProductTestCase(unittest.TestCase):
'''
Test Product module.
@@ -133,7 +135,6 @@ class ProductTestCase(unittest.TestCase):
uom = self.uom.browse(uom_id)
self.assert_(result == self.uom.select_accurate_field(uom))
def test0040uom_compute_qty(self):
'''
Test uom compute_qty function.
@@ -191,6 +192,7 @@ class ProductTestCase(unittest.TestCase):
self.assert_(result == self.uom.compute_price(from_uom,
price, to_uom))
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
+1
View File
@@ -10,6 +10,7 @@ STATES = {
}
DEPENDS = ['active']
class UomCategory(ModelSQL, ModelView):
'Product uom category'
_name = 'product.uom.category'