From 797310f8ef8327fc87c1017ddfd1f754d3f5f178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 23 Feb 2010 11:52:06 +0100 Subject: [PATCH] Use selection widget in create chart wizard for issue1394 It breaks the record rules if user create company from this wizard and it is not allow to create chart template so selection widget prevent this Add default value for company --- account.py | 7 +++++++ account.xml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/account.py b/account.py index 0b0f94d326..d287a5d874 100644 --- a/account.py +++ b/account.py @@ -1746,6 +1746,13 @@ class CreateChartAccountAccount(ModelView): account_template = fields.Many2One('account.account.template', 'Account Template', required=True, domain=[('parent', '=', False)]) + def default_company(self, cursor, user, context=None): + if context is None: + context = {} + if context.get('company'): + return context['company'] + return False + CreateChartAccountAccount() diff --git a/account.xml b/account.xml index d1bf86c1b3..a21ef0b302 100644 --- a/account.xml +++ b/account.xml @@ -461,9 +461,9 @@ this repository contains the full copyright notices and license terms. -->