Add missing domain on account type

All the tree of account type must be in the same company
This commit is contained in:
Cédric Krier committed 2011-04-11 11:34:51 +02:00
1 parent a13c63f8a9
commit 33cdcc59ad
1 file changed
+7 -2
+7 -2
View File
@@ -152,8 +152,13 @@ class Type(ModelSQL, ModelView):
_description = __doc__
name = fields.Char('Name', size=None, required=True, translate=True)
parent = fields.Many2One('account.account.type', 'Parent',
ondelete="RESTRICT")
childs = fields.One2Many('account.account.type', 'parent', 'Children')
ondelete="RESTRICT", domain=[
('company', '=', Eval('company')),
])
childs = fields.One2Many('account.account.type', 'parent', 'Children',
domain=[
('company', '=', Eval('company')),
])
sequence = fields.Integer('Sequence', required=True,
help='Use to order the account type')
currency_digits = fields.Function(fields.Integer('Currency Digits'),