Add translation of _constraints

This commit is contained in:
Cédric Krier
2008-08-05 11:36:25 +02:00
parent 2e6d649cd6
commit 3fc047157b
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -22,9 +22,11 @@ class Category(OSV):
def __init__(self):
super(Category, self).__init__()
self._constraints += [
('check_recursion',
'Error! You can not create recursive categories.', ['parent'])
('check_recursion', 'recursive_categories'),
]
self._error_messages.update({
'recursive_categories': 'You can not create recursive categories!',
})
self._order.insert(1, ('name', 'ASC'))
def default_active(self, cursor, user, context=None):
+4 -2
View File
@@ -97,9 +97,11 @@ class Party(OSV):
'The code of the party must be unique!')
]
self._constraints += [
('check_vat',
'Error! Wrong VAT number.', ['vat_number', 'vat_country']),
('check_vat', 'wrong_vat'),
]
self._error_messages.update({
'wrong_vat': 'Wrong VAT number!',
})
self._order.insert(0, ('name', 'DESC'))
def default_active(self, cursor, user, context=None):