Fix pep8 and pyflakes

This commit is contained in:
Cédric Krier committed 2012-04-03 20:07:11 +02:00
1 parent 57ceed6f69
commit fa48b6315c
5 files changed
+14 -10

No files matched your search

+5 -5
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' : 'Party',
'name': 'Party',
'name_bg_BG': 'Партньор',
'name_ca_ES': 'Tercers',
'name_de_DE': 'Parteien',
@@ -11,8 +11,8 @@
'name_fr_FR': 'Tiers',
'name_nl_NL': 'Relaties',
'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 parties, addresses and co.',
@@ -24,12 +24,12 @@
'description_fr_FR': 'Définit des tiers, des adresses, etc.',
'description_nl_NL': 'Definieert relaties, adressen en bedrijven.',
'description_ru_RU': 'Определение контрагентов, адресов и тп.',
'depends' : [
'depends': [
'ir',
'res',
'country',
],
'xml' : [
'xml': [
'party.xml',
'category.xml',
'address.xml',
+1
View File
@@ -52,6 +52,7 @@ class Category(ModelSQL, ModelView):
if not ids:
return {}
res = {}
def _name(category):
if category.id in res:
return res[category.id]
+1 -1
View File
@@ -49,7 +49,7 @@ class ContactMechanism(ModelSQL, ModelView):
'readonly': ~Eval('active', True),
}, on_change=['website'], depends=['value', 'type', 'active']),
'get_value', setter='set_value')
skype = fields.Function(fields.Char('Skype',states={
skype = fields.Function(fields.Char('Skype', states={
'invisible': Eval('type') != 'skype',
'required': Eval('type') == 'skype',
'readonly': ~Eval('active', True),
+4 -3
View File
@@ -119,7 +119,8 @@ class Party(ModelSQL, ModelView):
return []
res = {}
for party in self.browse(ids):
res[party.id] = (party.vat_country or '') + (party.vat_number or '')
res[party.id] = ((party.vat_country or '')
+ (party.vat_number or ''))
return res
def search_vat_code(self, name, clause):
@@ -261,8 +262,8 @@ class PartyCategory(ModelSQL):
_description = __doc__
party = fields.Many2One('party.party', 'Party', ondelete='CASCADE',
required=True, select=True)
category = fields.Many2One('party.category', 'Category', ondelete='CASCADE',
required=True, select=True)
category = fields.Many2One('party.category', 'Category',
ondelete='CASCADE', required=True, select=True)
PartyCategory()
+3 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env python
#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):
@@ -113,6 +114,7 @@ class PartyTestCase(unittest.TestCase):
})
self.assert_(party1_id)
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(PartyTestCase))