changeset 13b2b39ecd83 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=13b2b39ecd83
description:
        Use context model for charts

        issue11496
        review443121003
diffstat:

 CHANGELOG                               |    2 +
 __init__.py                             |    6 +-
 account.py                              |   61 ++++++--------
 account.xml                             |   42 +++------
 common.py                               |   31 +++++++
 doc/design/account.rst                  |   16 ---
 doc/design/tax.rst                      |   17 ---
 doc/usage/view.rst                      |   16 +--
 tax.py                                  |  138 ++++++++++++++++++++++---------
 tax.xml                                 |   47 +++++-----
 view/account_context_form.xml           |   11 ++
 view/account_tree2.xml                  |   12 --
 view/account_tree_chart.xml             |   11 ++
 view/open_chart_start_form.xml          |    9 --
 view/tax_code_context_form.xml          |   17 +++
 view/tax_code_open_chart_start_form.xml |   10 --
 view/tax_code_tree2.xml                 |    9 --
 view/tax_code_tree_chart.xml            |    8 +
 18 files changed, 251 insertions(+), 212 deletions(-)

diffs (696 lines):

diff -r 6d06c13574dd -r 13b2b39ecd83 CHANGELOG
--- a/CHANGELOG Fri Jun 24 09:19:13 2022 +0200
+++ b/CHANGELOG Mon Jul 18 00:04:04 2022 +0200
@@ -1,3 +1,5 @@
+* Use context model for chart of accounts and taxes
+
 Version 6.4.0 - 2022-05-02
 * Bug fixes (see mercurial logs for details)
 * Prevent creating fiscal year before closed one
diff -r 6d06c13574dd -r 13b2b39ecd83 __init__.py
--- a/__init__.py       Fri Jun 24 09:19:13 2022 +0200
+++ b/__init__.py       Mon Jul 18 00:04:04 2022 +0200
@@ -24,7 +24,7 @@
         account.AccountParty,
         account.AccountDeferral,
         account.AccountTax,
-        account.OpenChartAccountStart,
+        account.AccountContext,
         account.GeneralLedgerAccount,
         account.GeneralLedgerAccountContext,
         account.GeneralLedgerAccountParty,
@@ -68,7 +68,7 @@
         tax.TaxCode,
         tax.TaxCodeLineTemplate,
         tax.TaxCodeLine,
-        tax.OpenChartTaxCodeStart,
+        tax.TaxCodeContext,
         tax.TaxTemplate,
         tax.Tax,
         tax.TaxLine,
@@ -92,7 +92,6 @@
     Pool.register(
         account.OpenType,
         fiscalyear.BalanceNonDeferral,
-        account.OpenChartAccount,
         account.CreateChart,
         account.UpdateChart,
         account.OpenGeneralLedgerAccountParty,
@@ -105,7 +104,6 @@
         move.GroupLines,
         move.RescheduleLines,
         move_template.CreateMove,
-        tax.OpenChartTaxCode,
         tax.OpenTaxCode,
         tax.TestTax,
         party.PartyReplace,
diff -r 6d06c13574dd -r 13b2b39ecd83 account.py
--- a/account.py        Fri Jun 24 09:19:13 2022 +0200
+++ b/account.py        Mon Jul 18 00:04:04 2022 +0200
@@ -26,7 +26,7 @@
 from trytond.wizard import (
     Button, StateAction, StateTransition, StateView, Wizard)
 
-from .common import ActivePeriodMixin, PeriodMixin
+from .common import ActivePeriodMixin, ContextCompanyMixin, PeriodMixin
 from .exceptions import (
     AccountValidationError, ChartWarning, SecondCurrencyError)
 
@@ -827,7 +827,9 @@
             ondelete='RESTRICT', select=True, required=True)
 
 
-class Account(AccountMixin(), ActivePeriodMixin, tree(), ModelSQL, ModelView):
+class Account(
+        AccountMixin(), ContextCompanyMixin, ActivePeriodMixin, tree(),
+        ModelSQL, ModelView):
     'Account'
     __name__ = 'account.account'
     _states = {
@@ -1751,44 +1753,33 @@
             select=True, required=True)
 
 
-class OpenChartAccountStart(ModelView):
-    'Open Chart of Accounts'
-    __name__ = 'account.open_chart.start'
-    fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
-            help='Leave empty for all open fiscal year.')
+class AccountContext(ModelView):
+    'Account Context'
+    __name__ = 'account.account.context'
+
+    company = fields.Many2One('company.company', "Company", required=True)
+    fiscalyear = fields.Many2One(
+        'account.fiscalyear', "Fiscal Year",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ],
+        help="Leave empty for all open fiscal year.")
     posted = fields.Boolean('Posted Moves', help="Only include posted moves.")
 
-    @staticmethod
-    def default_posted():
+    @classmethod
+    def default_company(cls):
+        return Transaction().context.get('company')
+
+    @fields.depends('company', 'fiscalyear')
+    def on_change_company(self):
+        if self.fiscalyear and self.fiscalyear.company != self.company:
+            self.fiscalyear = None
+
+    @classmethod
+    def default_posted(cls):
         return False
 
 
-class OpenChartAccount(Wizard):
-    'Open Chart of Accounts'
-    __name__ = 'account.open_chart'
-    start = StateView('account.open_chart.start',
-        'account.open_chart_start_view_form', [
-            Button('Cancel', 'end', 'tryton-cancel'),
-            Button('Open', 'open_', 'tryton-ok', default=True),
-            ])
-    open_ = StateAction('account.act_account_tree2')
-
-    def do_open_(self, action):
-        action['pyson_context'] = PYSONEncoder().encode({
-            'fiscalyear': (self.start.fiscalyear.id
-                    if self.start.fiscalyear else None),
-            'posted': self.start.posted,
-            })
-        if self.start.fiscalyear:
-            action['name'] += ' - %s' % self.start.fiscalyear.rec_name
-        if self.start.posted:
-            action['name'] += '*'
-        return action, {}
-
-    def transition_open_(self):
-        return 'end'
-
-
 class _GeneralLedgerAccount(ActivePeriodMixin, ModelSQL, ModelView):
 
     account = fields.Many2One('account.account', "Account")
diff -r 6d06c13574dd -r 13b2b39ecd83 account.xml
--- a/account.xml       Fri Jun 24 09:19:13 2022 +0200
+++ b/account.xml       Mon Jul 18 00:04:04 2022 +0200
@@ -86,11 +86,6 @@
             sequence="30"
             id="menu_entries"/>
         <menuitem
-            name="Charts"
-            parent="menu_account"
-            sequence="40"
-            id="menu_charts"/>
-        <menuitem
             name="Processing"
             parent="menu_account"
             sequence="50"
@@ -473,36 +468,31 @@
             <field name="action" ref="act_open_type"/>
         </record>
 
-        <record model="ir.ui.view" id="account_view_tree2">
+        <record model="ir.ui.view" id="account_view_tree_chart">
             <field name="model">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">Accounts</field>
+        <record model="ir.action.act_window" id="act_account_tree_chart">
+            <field name="name">Chart of Accounts</field>
             <field name="res_model">account.account</field>
+            <field name="context_model">account.account.context</field>
             <field name="domain"
-                eval="[('parent', '=', None), ('company', '=', Eval('context', 
{}).get('company', -1))]"
+                eval="[('parent', '=', None), ('context_company', '=', True)]"
                 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"/>
-        </record>
-
-        <record model="ir.action.wizard" id="act_open_chart">
-            <field name="name">Open Chart of Accounts</field>
-            <field name="wiz_name">account.open_chart</field>
+            <field name="view" ref="account_view_tree_chart"/>
+            <field name="act_window" ref="act_account_tree_chart"/>
         </record>
         <menuitem
-            parent="menu_charts"
-            action="act_open_chart"
-            sequence="10"
-            id="menu_open_chart"
-            icon="tryton-tree"/>
+            parent="menu_reporting"
+            action="act_account_tree_chart"
+            sequence="30"
+            id="menu_account_tree_chart"/>
 
         <record model="ir.model.access" id="access_account">
             <field name="model" search="[('model', '=', 'account.account')]"/>
@@ -572,10 +562,10 @@
             <field name="rule_group" ref="rule_group_account_companies"/>
         </record>
 
-        <record model="ir.ui.view" id="open_chart_start_view_form">
-            <field name="model">account.open_chart.start</field>
+        <record model="ir.ui.view" id="account_context_view_form">
+            <field name="model">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.action.report" id="report_general_ledger">
diff -r 6d06c13574dd -r 13b2b39ecd83 common.py
--- a/common.py Fri Jun 24 09:19:13 2022 +0200
+++ b/common.py Mon Jul 18 00:04:04 2022 +0200
@@ -142,3 +142,34 @@
         else:
             expression = Literal(True)
         return expression
+
+
+class ContextCompanyMixin(Model):
+
+    context_company = fields.Function(fields.Boolean("Context Company"),
+        'get_context_company')
+
+    def get_context_company(self, name):
+        context = Transaction().context
+        return self.company.id == context.get('company')
+
+    @classmethod
+    def domain_context_company(cls, domain, tables):
+        context = Transaction().context
+        table, _ = tables[None]
+        _, operator, value = domain
+
+        expression = table.company == context.get('company')
+        if operator in {'=', '!='}:
+            if (operator == '=') != value:
+                expression = ~expression
+        elif operator in {'in', 'not in'}:
+            if True in value and False not in value:
+                pass
+            elif False in value and True not in value:
+                expression = ~expression
+            else:
+                expression = Literal(True)
+        else:
+            expression = Literal(True)
+        return expression
diff -r 6d06c13574dd -r 13b2b39ecd83 doc/design/account.rst
--- a/doc/design/account.rst    Fri Jun 24 09:19:13 2022 +0200
+++ b/doc/design/account.rst    Mon Jul 18 00:04:04 2022 +0200
@@ -44,22 +44,6 @@
    Accounts can be created from
    `Account Templates <model-account.account.template>`.
 
-Wizards
--------
-
-.. _wizard-account.open_chart:
-
-Open Chart of Accounts
-^^^^^^^^^^^^^^^^^^^^^^
-
-This wizard opens the company's chart of accounts.
-
-.. seealso::
-
-   The chart of accounts can be opened using the main menu item:
-
-      :menuselection:`Financial --> Charts --> Open Chart of Accounts`
-
 .. _model-account.account.type:
 
 Account Type
diff -r 6d06c13574dd -r 13b2b39ecd83 doc/design/tax.rst
--- a/doc/design/tax.rst        Fri Jun 24 09:19:13 2022 +0200
+++ b/doc/design/tax.rst        Mon Jul 18 00:04:04 2022 +0200
@@ -132,20 +132,3 @@
 
    Tax codes can be created from
    `Tax Code Templates <model-account.tax.code.template>`.
-
-Wizards
--------
-
-.. _wizard-account.tax.code.open_chart:
-
-Open Chart of Tax Codes
-^^^^^^^^^^^^^^^^^^^^^^^
-
-The *Open Chart of Tax Codes* wizard opens the chart of tax codes, showing the
-tax codes and amounts for the selected periods of time.
-
-.. seealso::
-
-   The open chart tax code wizard can be started from the main menu item:
-
-      :menuselection:`Financial --> Charts --> Open Tax Chart`
diff -r 6d06c13574dd -r 13b2b39ecd83 doc/usage/view.rst
--- a/doc/usage/view.rst        Fri Jun 24 09:19:13 2022 +0200
+++ b/doc/usage/view.rst        Mon Jul 18 00:04:04 2022 +0200
@@ -30,11 +30,9 @@
 Viewing your chart of accounts data
 ===================================
 
-The `Open Chart of Accounts <wizard-account.open_chart>` wizard can be run
-from the main menu to open your chart of accounts.
-
-This provides a structured view of all the `Accounts <model-account.account>`
-that form your `Company's <company:model-company.company>` accounts.
+The [:menuselection:`Financial --> Reporting -> Chart of Accounts`] provides a
+structured view of all the `Accounts <model-account.account>` that form your
+`Company's <company:model-company.company>` accounts.
 
 .. tip::
 
@@ -47,11 +45,9 @@
 Viewing your tax code data
 ==========================
 
-The `Open Chart of Tax Codes <wizard-account.tax.code.open_chart>` wizard can
-be run from the main menu to open your chart of tax codes.
-
-From here you are able to see data about what `Taxes <model-account.tax>` have
-been applied and what amounts these were based on.
+From [:menuselection:`Financial --> Reporting -> Chart of Tax Codes`] you are
+able to see data about what `Taxes <model-account.tax>` have been applied and
+what amounts these were based on.
 The `Tax Codes <model-account.tax.code>` are normally structured so that you
 can find the data that you need to do your tax reporting.
 
diff -r 6d06c13574dd -r 13b2b39ecd83 tax.py
--- a/tax.py    Fri Jun 24 09:19:13 2022 +0200
+++ b/tax.py    Mon Jul 18 00:04:04 2022 +0200
@@ -22,7 +22,7 @@
 from trytond.transaction import Transaction
 from trytond.wizard import Button, StateAction, StateView, Wizard
 
-from .common import ActivePeriodMixin, PeriodMixin
+from .common import ActivePeriodMixin, ContextCompanyMixin, PeriodMixin
 
 KINDS = [
     ('sale', 'Sale'),
@@ -121,7 +121,8 @@
             childs = sum((c.childs for c in childs), ())
 
 
-class TaxCode(ActivePeriodMixin, tree(), ModelSQL, ModelView):
+class TaxCode(
+        ContextCompanyMixin, ActivePeriodMixin, tree(), ModelSQL, ModelView):
     'Tax Code'
     __name__ = 'account.tax.code'
     _states = {
@@ -462,59 +463,114 @@
             cls.write(*values)
 
 
-class OpenChartTaxCodeStart(ModelView):
-    'Open Chart of Tax Codes'
-    __name__ = 'account.tax.code.open_chart.start'
+class TaxCodeContext(ModelView):
+    "Tax Code Context"
+    __name__ = 'account.tax.code.context'
+
+    company = fields.Many2One('company.company', "Company", required=True)
     method = fields.Selection([
-        ('fiscalyear', 'By Fiscal Year'),
-        ('periods', 'By Periods'),
-        ], 'Method', required=True)
-    fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
-        help='Leave empty for all open fiscal year.',
+            ('fiscalyear', "By Fiscal Year"),
+            ('period', "By Period"),
+            ('periods', "Over Periods"),
+            ], 'Method', required=True)
+
+    fiscalyear = fields.Many2One(
+        'account.fiscalyear', "Fiscal Year",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ],
         states={
             'invisible': Eval('method') != 'fiscalyear',
             'required': Eval('method') == 'fiscalyear',
             })
-    periods = fields.Many2Many('account.period', None, None, 'Periods',
-        help='Leave empty for all periods of all open fiscal year.',
+
+    period = fields.Many2One(
+        'account.period', "Period",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ('type', '=', 'standard'),
+            ],
+        states={
+            'invisible': Eval('method') != 'period',
+            'required': Eval('method') == 'period',
+            })
+
+    start_period = fields.Many2One(
+        'account.period', "Start Period",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ('type', '=', 'standard'),
+            ('start_date', '<=', (Eval('end_period'), 'start_date')),
+            ],
+        states={
+            'invisible': Eval('method') != 'periods',
+            'required': Eval('method') == 'periods',
+            })
+    end_period = fields.Many2One(
+        'account.period', "End Period",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ('type', '=', 'standard'),
+            ('start_date', '>=', (Eval('start_period'), 'start_date')),
+            ],
         states={
             'invisible': Eval('method') != 'periods',
             'required': Eval('method') == 'periods',
             })
 
-    @staticmethod
-    def default_method():
-        return 'periods'
+    periods = fields.Many2Many(
+        'account.period', None, None, "Periods",
+        domain=[
+            ('company', '=', Eval('company', -1)),
+            ('type', '=', 'standard'),
+            ])
 
+    @classmethod
+    def default_company(cls):
+        return Transaction().context.get('company')
 
-class OpenChartTaxCode(Wizard):
-    'Open Chart of Tax Codes'
-    __name__ = 'account.tax.code.open_chart'
-    start = StateView('account.tax.code.open_chart.start',
-        'account.tax_code_open_chart_start_view_form', [
-            Button('Cancel', 'end', 'tryton-cancel'),
-            Button('Open', 'open_', 'tryton-ok', default=True),
-            ])
-    open_ = StateAction('account.act_tax_code_tree2')
+    @fields.depends(
+        'company', 'fiscalyear', 'period', methods=['on_change_with_periods'])
+    def on_change_company(self):
+        if self.fiscalyear and self.fiscalyear.company != self.company:
+            self.fiscalyear = None
+        if self.period and self.period.company != self.company:
+            self.period = None
+        self.periods = self.on_change_with_periods()
+
+    @classmethod
+    def default_method(cls):
+        return 'period'
 
-    def do_open_(self, action):
-        periods = []
-        if self.start.method == 'fiscalyear':
-            if self.start.fiscalyear:
-                periods = self.start.fiscalyear.periods
-                action['name'] += ' - %s' % self.start.fiscalyear.rec_name
-        elif self.start.method == 'periods':
-            if self.start.periods:
-                periods = self.start.periods
-                action['name'] += ' (%s)' % ', '.join(
-                    p.rec_name for p in self.start.periods)
-        action['pyson_context'] = PYSONEncoder().encode({
-                'periods': [p.id for p in periods],
-                })
-        return action, {}
+    @classmethod
+    def default_period(cls):
+        pool = Pool()
+        Period = pool.get('account.period')
+        return Period.find(
+            cls.default_company(), exception=False, test_state=False)
 
-    def transition_open_(self):
-        return 'end'
+    @fields.depends(
+        'method', 'company',
+        'fiscalyear', 'period', 'start_period', 'end_period')
+    def on_change_with_periods(self):
+        pool = Pool()
+        Period = pool.get('account.period')
+        if self.method == 'fiscalyear' and self.fiscalyear:
+            return [
+                p.id for p in self.fiscalyear.periods if p.type == 'standard']
+        elif self.method == 'period' and self.period:
+            return [self.period.id]
+        elif (self.method == 'periods'
+                and self.company
+                and self.start_period and self.end_period):
+            periods = Period.search([
+                    ('start_date', '>=', self.start_period.start_date),
+                    ('start_date', '<=', self.end_period.start_date),
+                    ('company', '=', self.company.id),
+                    ('type', '=', 'standard'),
+                    ])
+            return [p.id for p in periods]
+        return []
 
 
 class TaxTemplate(sequence_ordered(), ModelSQL, ModelView, DeactivableMixin):
diff -r 6d06c13574dd -r 13b2b39ecd83 tax.xml
--- a/tax.xml   Fri Jun 24 09:19:13 2022 +0200
+++ b/tax.xml   Mon Jul 18 00:04:04 2022 +0200
@@ -153,37 +153,38 @@
             sequence="10"
             id="menu_tax_code_list"/>
 
-        <record model="ir.ui.view" id="tax_code_view_tree2">
+        <record model="ir.ui.view" id="tax_code_view_tree_chart">
             <field name="model">account.tax.code</field>
             <field name="type">tree</field>
             <field name="field_childs">childs</field>
-            <field name="name">tax_code_tree2</field>
+            <field name="name">tax_code_tree_chart</field>
         </record>
-        <record model="ir.action.act_window" id="act_tax_code_tree2">
-            <field name="name">Tax Codes</field>
+
+        <record model="ir.action.act_window" id="act_tax_code_tree_chart">
+            <field name="name">Chart of Tax Codes</field>
             <field name="res_model">account.tax.code</field>
-            <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
-        </record>
-        <record model="ir.action.act_window.view" 
id="act_tax_code_tree2_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="tax_code_view_tree2"/>
-            <field name="act_window" ref="act_tax_code_tree2"/>
+            <field name="context_model">account.tax.code.context</field>
+            <field name="domain"
+                eval="[('parent', '=', None), ('context_company', '=', True)]"
+                pyson="1"/>
         </record>
-        <record model="ir.ui.view" id="tax_code_open_chart_start_view_form">
-            <field name="model">account.tax.code.open_chart.start</field>
-            <field name="type">form</field>
-            <field name="name">tax_code_open_chart_start_form</field>
+        <record model="ir.action.act_window.view" 
id="act_tax_code_tree_chart_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="tax_code_view_tree_chart"/>
+            <field name="act_window" ref="act_tax_code_tree_chart"/>
         </record>
-        <record model="ir.action.wizard" id="act_code_tax_open_chart">
-            <field name="name">Open Chart of Tax Codes</field>
-            <field name="wiz_name">account.tax.code.open_chart</field>
-        </record>
+
         <menuitem
-            parent="menu_charts"
-            action="act_code_tax_open_chart"
-            sequence="20"
-            id="menu_code_tax_open_chart"
-            icon="tryton-tree"/>
+            parent="menu_reporting"
+            action="act_tax_code_tree_chart"
+            sequence="30"
+            id="menu_tax_code_tree_chart"/>
+
+        <record model="ir.ui.view" id="tax_code_context_view_form">
+            <field name="model">account.tax.code.context</field>
+            <field name="type">form</field>
+            <field name="name">tax_code_context_form</field>
+        </record>
 
         <record model="ir.model.access" id="access_tax_code">
             <field name="model" search="[('model', '=', 'account.tax.code')]"/>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/account_context_form.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/account_context_form.xml     Mon Jul 18 00:04:04 2022 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<form col="6">
+    <label name="fiscalyear"/>
+    <field name="fiscalyear"/>
+    <label name="company"/>
+    <field name="company"/>
+    <label name="posted"/>
+    <field name="posted"/>
+</form>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/account_tree2.xml
--- a/view/account_tree2.xml    Fri Jun 24 09:19:13 2022 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tree keyword_open="1">
-    <field name="name" expand="2"/>
-    <field name="code" optional="0"/>
-    <field name="company" expand="1" optional="1"/>
-    <field name="debit" optional="0"/>
-    <field name="credit" optional="0"/>
-    <field name="balance" optional="0"/>
-    <field name="amount_second_currency" optional="1"/>
-</tree>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/account_tree_chart.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/account_tree_chart.xml       Mon Jul 18 00:04:04 2022 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree keyword_open="1">
+    <field name="name" expand="2"/>
+    <field name="code" optional="0"/>
+    <field name="debit" optional="0"/>
+    <field name="credit" optional="0"/>
+    <field name="balance" optional="0"/>
+    <field name="amount_second_currency" optional="1"/>
+</tree>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/open_chart_start_form.xml
--- a/view/open_chart_start_form.xml    Fri Jun 24 09:19:13 2022 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<form col="2">
-    <label name="fiscalyear"/>
-    <field name="fiscalyear"/>
-    <label name="posted"/>
-    <field name="posted"/>
-</form>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/tax_code_context_form.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/tax_code_context_form.xml    Mon Jul 18 00:04:04 2022 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<form col="6">
+    <label name="company"/>
+    <field name="company"/>
+    <label name="method"/>
+    <field name="method"/>
+    <group id="method" col="-1" colspan="2">
+        <field name="fiscalyear"/>
+        <field name="period"/>
+        <field name="start_period"/>
+        <field name="end_period"/>
+    </group>
+
+    <field name="periods" colspan="6" invisible="1"/>
+</form>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/tax_code_open_chart_start_form.xml
--- a/view/tax_code_open_chart_start_form.xml   Fri Jun 24 09:19:13 2022 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<form col="2">
-    <label name="method"/>
-    <field name="method"/>
-    <label name="fiscalyear"/>
-    <field name="fiscalyear"/>
-    <field name="periods" colspan="2"/>
-</form>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/tax_code_tree2.xml
--- a/view/tax_code_tree2.xml   Fri Jun 24 09:19:13 2022 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tree keyword_open="1">
-    <field name="code"/>
-    <field name="name" expand="1" optional="0"/>
-    <field name="company" expand="1" optional="1"/>
-    <field name="amount" optional="0"/>
-</tree>
diff -r 6d06c13574dd -r 13b2b39ecd83 view/tax_code_tree_chart.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/tax_code_tree_chart.xml      Mon Jul 18 00:04:04 2022 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree keyword_open="1">
+    <field name="code"/>
+    <field name="name" expand="1" optional="0"/>
+    <field name="amount" optional="0"/>
+</tree>

Reply via email to