Replace tree open wizard by simple relate

This allow to preserve the full context from balance sheet or income
statement.
Unfortunately both reports are using a different context model so it is not
possible to use a common context model on the account view.

issue6747
review36631002
This commit is contained in:
Cédric Krier committed 2017-09-27 18:52:35 +02:00
1 parent ee6994adaa
commit 67cda0a166
3 files changed
+8 -28

No files matched your search

-1
View File
@@ -80,7 +80,6 @@ def register():
PartyAccount,
module='account', type_='model')
Pool.register(
OpenType,
BalanceNonDeferral,
OpenChartAccount,
CreateChart,
+1 -20
View File
@@ -20,7 +20,7 @@ from trytond.transaction import Transaction
from trytond.pool import Pool
from trytond import backend
__all__ = ['TypeTemplate', 'Type', 'OpenType',
__all__ = ['TypeTemplate', 'Type',
'AccountTemplate', 'AccountTemplateTaxTemplate',
'Account', 'AccountDeferral', 'AccountTax',
'OpenChartAccountStart', 'OpenChartAccount',
@@ -305,25 +305,6 @@ class Type(sequence_ordered(), ModelSQL, ModelView):
self.write(*values)
class OpenType(Wizard):
'Open Type'
__name__ = 'account.account.open_type'
start_state = 'open_'
open_ = StateAction('account.act_account_list2')
def do_open_(self, action):
action['pyson_domain'] = PYSONEncoder().encode([
('type', '=', Transaction().context['active_id']),
('kind', '!=', 'view'),
])
action['pyson_context'] = PYSONEncoder().encode({
'date': Transaction().context.get('date'),
'posted': Transaction().context.get('posted'),
'cumulate': Transaction().context.get('cumulate'),
})
return action, {}
class AccountTemplate(ModelSQL, ModelView):
'Account Template'
__name__ = 'account.account.template'
+7 -7
View File
@@ -357,22 +357,22 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_account_list2">
<field name="name">Accounts</field>
<field name="res_model">account.account</field>
<field name="context_domain"
eval="[('company', '=', Eval('company', -1))]"
pyson="1"/>
<field name="domain"
eval="[('type', 'child_of', Eval('active_id'), 'parent'), ('kind', '!=', 'view')]"
pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_account_list2_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="account_view_list2"/>
<field name="act_window" ref="act_account_list2"/>
</record>
<record model="ir.action.wizard" id="act_open_type">
<field name="name">Open Type</field>
<field name="wiz_name">account.account.open_type</field>
<field name="model">account.account.type</field>
</record>
<record model="ir.action.keyword" id="act_open_type_keyword">
<field name="keyword">tree_open</field>
<field name="model">account.account.type,-1</field>
<field name="action" ref="act_open_type"/>
<field name="action" ref="act_account_list2"/>
</record>
<record model="ir.ui.view" id="account_view_tree2">