From 67cda0a16616b95a258d60f2ee7f6727ed857f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 27 Sep 2017 18:52:35 +0200 Subject: [PATCH] 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 --- __init__.py | 1 - account.py | 21 +-------------------- account.xml | 14 +++++++------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/__init__.py b/__init__.py index 73d5853dd4..5c5d7a98f8 100644 --- a/__init__.py +++ b/__init__.py @@ -80,7 +80,6 @@ def register(): PartyAccount, module='account', type_='model') Pool.register( - OpenType, BalanceNonDeferral, OpenChartAccount, CreateChart, diff --git a/account.py b/account.py index 5c1edfb8bd..3a4561f708 100644 --- a/account.py +++ b/account.py @@ -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' diff --git a/account.xml b/account.xml index 01115e704b..3240face2d 100644 --- a/account.xml +++ b/account.xml @@ -357,22 +357,22 @@ this repository contains the full copyright notices and license terms. --> Accounts account.account + + - - - Open Type - account.account.open_type - account.account.type - tree_open account.account.type,-1 - +