From 387ee3e05a15a1312eb4d3531489dfadb66b2d66 Mon Sep 17 00:00:00 2001 From: william Date: Tue, 14 Apr 2020 12:46:40 +0000 Subject: [PATCH] [FIX] account: account type selection in list view The custom selection widget was only used in the form. A small rework had to be done to make it work in list views because the values were not pre loaded. closes odoo/odoo#49604 X-original-commit: cf942e6df3bf065e299d8ad0dcfd8ed2cc66b29c Signed-off-by: Cedric Snauwaert (csn) Signed-off-by: wan --- addons/account/static/src/js/account_selection.js | 11 ++++++----- addons/account/views/account_account_views.xml | 2 +- addons/account/views/account_chart_template_views.xml | 2 +- addons/account/wizard/setup_wizards_view.xml | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/account/static/src/js/account_selection.js b/addons/account/static/src/js/account_selection.js index a43083867d8..d098505b593 100644 --- a/addons/account/static/src/js/account_selection.js +++ b/addons/account/static/src/js/account_selection.js @@ -18,12 +18,13 @@ odoo.define('account.hierarchy.selection', function (require) { if (!self.hierarchy_groups) { prom = this._rpc({ model: 'account.account.type', - method: 'read', - args: [ - _.filter(_.map(this.values, v => v[0]), v => typeof v == 'number'), - ['internal_group'], - ], + method: 'search_read', + kwargs: { + domain: [], + fields: ['id', 'internal_group', 'display_name'], + }, }).then(function(arg) { + self.values = _.map(arg, v => [v['id'], v['display_name']]) self.hierarchy_groups = [ { 'name': _('Balance Sheet'), diff --git a/addons/account/views/account_account_views.xml b/addons/account/views/account_account_views.xml index 52b5f26125a..4fe5c202b41 100644 --- a/addons/account/views/account_account_views.xml +++ b/addons/account/views/account_account_views.xml @@ -54,7 +54,7 @@ - + diff --git a/addons/account/views/account_chart_template_views.xml b/addons/account/views/account_chart_template_views.xml index 1ec9e6ea945..db0c38a360f 100644 --- a/addons/account/views/account_chart_template_views.xml +++ b/addons/account/views/account_chart_template_views.xml @@ -105,7 +105,7 @@ - + diff --git a/addons/account/wizard/setup_wizards_view.xml b/addons/account/wizard/setup_wizards_view.xml index f6af2ceb31b..d5158f84df1 100644 --- a/addons/account/wizard/setup_wizards_view.xml +++ b/addons/account/wizard/setup_wizards_view.xml @@ -78,7 +78,7 @@ - +