[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) <csn@openerp.com> Signed-off-by: wan <william-andre@users.noreply.github.com>
This commit is contained in:
@@ -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'),
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<tree editable="top" create="1" delete="1" multi_edit="1" string="Chart of accounts">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="user_type_id"/>
|
||||
<field name="user_type_id" widget="account_hierarchy_selection"/>
|
||||
<field name="internal_type" invisible="1"/>
|
||||
<field name="internal_group" invisible="1"/>
|
||||
<field name="reconcile" widget="boolean_toggle" attrs="{'invisible': ['|', ('internal_type','=','liquidity'), ('internal_group', '=', 'off_balance')]}"/>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<tree string="Account Template">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="user_type_id" invisible="1"/>
|
||||
<field name="user_type_id" widget="account_hierarchy_selection" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="user_type_id"/>
|
||||
<field name="user_type_id" widget="account_hierarchy_selection"/>
|
||||
<field name="reconcile" widget="boolean_toggle"/>
|
||||
<field name="opening_debit"/>
|
||||
<field name="opening_credit"/>
|
||||
|
||||
Reference in New Issue
Block a user