Update only chart of account linked to a template
issue10708 review343051004
This commit is contained in:
1 parent
b7f69233e6
commit
3364f2236a
1 file changed
+7
-2
+7
-2
@@ -2750,8 +2750,12 @@ class CreateChart(Wizard):
|
||||
class UpdateChartStart(ModelView):
|
||||
'Update Chart'
|
||||
__name__ = 'account.update_chart.start'
|
||||
account = fields.Many2One('account.account', 'Root Account',
|
||||
required=True, domain=[('parent', '=', None)])
|
||||
account = fields.Many2One(
|
||||
'account.account', "Root Account", required=True,
|
||||
domain=[
|
||||
('parent', '=', None),
|
||||
('template', '!=', None),
|
||||
])
|
||||
|
||||
|
||||
class UpdateChartSucceed(ModelView):
|
||||
@@ -2781,6 +2785,7 @@ class UpdateChart(Wizard):
|
||||
with Transaction().set_context(_check_access=True):
|
||||
charts = Account.search([
|
||||
('parent', '=', None),
|
||||
('template', '!=', None),
|
||||
], limit=2)
|
||||
if len(charts) == 1:
|
||||
defaults['account'] = charts[0].id
|
||||
|
||||
Reference in new issue
Block a user