[IMP] account: review the hierarchy of account type selection
* Add an equity section inside the balance sheet * Divide profit and loss into Expense and Income * Reorder the Expense and Income types closes odoo/odoo#36599 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
@@ -72,26 +72,26 @@
|
||||
<field name="internal_group">equity</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_revenue">
|
||||
<field name="name">Income</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">income</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_other_income">
|
||||
<field name="name">Other Income</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">income</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_revenue">
|
||||
<field name="name">Income</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">income</field>
|
||||
<record model="account.account.type" id="data_account_type_expenses">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_depreciation">
|
||||
<field name="name">Depreciation</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_expenses">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="type">other</field>
|
||||
<field name="internal_group">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_direct_costs">
|
||||
<field name="name">Cost of Revenue</field>
|
||||
<field name="type">other</field>
|
||||
|
||||
@@ -29,10 +29,17 @@ odoo.define('account.hierarchy.selection', function (require) {
|
||||
'name': _('Balance Sheet'),
|
||||
'children': [
|
||||
{'name': _t('Assets'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'asset'), v => v['id'])},
|
||||
{'name': _t('Liabilities'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'liability' || v['internal_group'] == 'equity'), v => v['id'])},
|
||||
]
|
||||
{'name': _t('Liabilities'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'liability'), v => v['id'])},
|
||||
{'name': _t('Equity'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'equity'), v => v['id'])},
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': _t('Profit & Loss'),
|
||||
'children': [
|
||||
{'name': _t('Income'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'income'), v => v['id'])},
|
||||
{'name': _t('Expense'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'expense'), v => v['id'])},
|
||||
],
|
||||
},
|
||||
{'name': _t('Profit & Loss'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'income' || v['internal_group'] == 'expense'), v => v['id'])},
|
||||
{'name': _t('Other'), 'ids': _.map(_.filter(arg, v => !['asset', 'liability', 'equity', 'income', 'expense'].includes(v['internal_group'])), v => v['id'])},
|
||||
]
|
||||
});
|
||||
@@ -52,7 +59,7 @@ odoo.define('account.hierarchy.selection', function (require) {
|
||||
var self = this;
|
||||
_.each(group, function(item) {
|
||||
var optgroup = $('<optgroup/>').attr(({
|
||||
'label': $('<div/>').html(' '.repeat(3 * level) + item['name']).text(),
|
||||
'label': $('<div/>').html(' '.repeat(6 * level) + item['name']).text(),
|
||||
}))
|
||||
_.each(item['ids'], function(id) {
|
||||
var value = _.find(self.values, v => v[0] == id)
|
||||
|
||||
Reference in New Issue
Block a user