Add translation of _constraints
This commit is contained in:
+4
-2
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user