Use context model for charts
issue11496 review443121003
This commit is contained in:
1 parent
ee4a863dcb
commit
4333f27798
6 files changed
+22
-46
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Use context model for chart of analytic accounts
|
||||
|
||||
Version 6.4.0 - 2022-05-02
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Add support for Python 3.10
|
||||
|
||||
+1
-2
@@ -13,7 +13,7 @@ def register():
|
||||
Pool.register(
|
||||
account.Account,
|
||||
account.AccountDistribution,
|
||||
account.OpenChartAccountStart,
|
||||
account.AccountContext,
|
||||
account.AnalyticAccountEntry,
|
||||
line.Line,
|
||||
line.Move,
|
||||
@@ -21,6 +21,5 @@ def register():
|
||||
rule.Rule,
|
||||
module='analytic_account', type_='model')
|
||||
Pool.register(
|
||||
account.OpenChartAccount,
|
||||
line.OpenAccount,
|
||||
module='analytic_account', type_='wizard')
|
||||
+2
-24
@@ -16,7 +16,6 @@ from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, If, PYSONDecoder, PYSONEncoder
|
||||
from trytond.tools import lstrip_wildcard
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Button, StateAction, StateView, Wizard
|
||||
|
||||
from .exceptions import AccountValidationError
|
||||
|
||||
@@ -297,34 +296,13 @@ class Account(
|
||||
return result
|
||||
|
||||
|
||||
class OpenChartAccountStart(ModelView):
|
||||
class AccountContext(ModelView):
|
||||
'Open Chart of Accounts'
|
||||
__name__ = 'analytic_account.open_chart.start'
|
||||
__name__ = 'analytic_account.account.context'
|
||||
start_date = fields.Date('Start Date')
|
||||
end_date = fields.Date('End Date')
|
||||
|
||||
|
||||
class OpenChartAccount(Wizard):
|
||||
'Open Chart of Accounts'
|
||||
__name__ = 'analytic_account.open_chart'
|
||||
start = StateView('analytic_account.open_chart.start',
|
||||
'analytic_account.open_chart_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Open', 'open_', 'tryton-ok', default=True),
|
||||
])
|
||||
open_ = StateAction('analytic_account.act_account_tree2')
|
||||
|
||||
def do_open_(self, action):
|
||||
action['pyson_context'] = PYSONEncoder().encode({
|
||||
'start_date': self.start.start_date,
|
||||
'end_date': self.start.end_date,
|
||||
})
|
||||
return action, {}
|
||||
|
||||
def transition_open_(self):
|
||||
return 'end'
|
||||
|
||||
|
||||
class AccountDistribution(ModelView, ModelSQL):
|
||||
"Analytic Account Distribution"
|
||||
__name__ = 'analytic_account.account.distribution'
|
||||
|
||||
+17
-20
@@ -77,38 +77,35 @@ this repository contains the full copyright notices and license terms. -->
|
||||
sequence="10"
|
||||
id="menu_account_list"/>
|
||||
|
||||
<record model="ir.ui.view" id="account_view_tree2">
|
||||
<record model="ir.ui.view" id="account_view_tree_chart">
|
||||
<field name="model">analytic_account.account</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="field_childs">childs</field>
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="name">account_tree2</field>
|
||||
<field name="name">account_tree_chart</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_account_tree2">
|
||||
<field name="name">Analytic Accounts</field>
|
||||
<record model="ir.action.act_window" id="act_account_tree_chart">
|
||||
<field name="name">Chart of Analytic Accounts</field>
|
||||
<field name="res_model">analytic_account.account</field>
|
||||
<field name="context_model">analytic_account.account.context</field>
|
||||
<field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_account_tree2_view1">
|
||||
<record model="ir.action.act_window.view" id="act_account_tree_chart_view1">
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="view" ref="account_view_tree2"/>
|
||||
<field name="act_window" ref="act_account_tree2"/>
|
||||
<field name="view" ref="account_view_tree_chart"/>
|
||||
<field name="act_window" ref="act_account_tree_chart"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_account_tree2_view2">
|
||||
<record model="ir.action.act_window.view" id="act_account_tree_chart_view2">
|
||||
<field name="sequence" eval="20"/>
|
||||
<field name="view" ref="account_view_form"/>
|
||||
<field name="act_window" ref="act_account_tree2"/>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="act_open_chart">
|
||||
<field name="name">Open Chart of Analytic Accounts</field>
|
||||
<field name="wiz_name">analytic_account.open_chart</field>
|
||||
<field name="act_window" ref="act_account_tree_chart"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_charts"
|
||||
action="act_open_chart"
|
||||
parent="account.menu_reporting"
|
||||
action="act_account_tree_chart"
|
||||
sequence="30"
|
||||
id="menu_open_chart"
|
||||
icon="tryton-tree"/>
|
||||
id="menu_account_tree_chart"/>
|
||||
|
||||
<record model="ir.rule.group" id="rule_group_account_companies">
|
||||
<field name="name">User in companies</field>
|
||||
@@ -169,10 +166,10 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="perm_delete" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="open_chart_start_view_form">
|
||||
<field name="model">analytic_account.open_chart.start</field>
|
||||
<record model="ir.ui.view" id="account_context_view_form">
|
||||
<field name="model">analytic_account.account.context</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">open_chart_start_form</field>
|
||||
<field name="name">account_context_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="analytic_account_entry_view_form">
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user