From 33cdcc59ada4bed5c9427894e11d211e3921d332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 11 Apr 2011 11:34:51 +0200 Subject: [PATCH] Add missing domain on account type All the tree of account type must be in the same company --- account.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 13365630a0..4e82e9dcb6 100644 --- a/account.py +++ b/account.py @@ -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'),