diff --git a/__tryton__.py b/__tryton__.py index 6cac398e90..b43e292e57 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -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', diff --git a/category.py b/category.py index f3adf906c0..dacca4161f 100644 --- a/category.py +++ b/category.py @@ -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] diff --git a/contact_mechanism.py b/contact_mechanism.py index 1ad7b664d5..cadee5645e 100644 --- a/contact_mechanism.py +++ b/contact_mechanism.py @@ -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), diff --git a/party.py b/party.py index e0b0e7fbdc..f5166bbf43 100644 --- a/party.py +++ b/party.py @@ -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() diff --git a/tests/test_party.py b/tests/test_party.py index db35e84c10..358ecdc34b 100644 --- a/tests/test_party.py +++ b/tests/test_party.py @@ -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))