changeset f913064c56f5 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=f913064c56f5
description:
Update only chart of account linked to a template
issue10708
review343051004
diffstat:
account.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r d7cec7fda427 -r f913064c56f5 account.py
--- a/account.py Fri Aug 27 09:03:48 2021 +0200
+++ b/account.py Sun Sep 19 00:34:38 2021 +0200
@@ -2750,8 +2750,12 @@
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 @@
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