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
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -461,9 +461,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<![CDATA[
|
||||
<form string="Create Chart of Account" col="2">
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<field name="company" widget="selection"/>
|
||||
<label name="account_template"/>
|
||||
<field name="account_template"/>
|
||||
<field name="account_template" widget="selection"/>
|
||||
</form>
|
||||
]]>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user