changeset 649405436fe2 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=649405436fe2
description:
        Set states to tax template's invoice and credit note accounts

        The states should be consistent with the tax

        issue8530
        review261891002
diffstat:

 tax.py |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 916a8f8aabe1 -r 649405436fe2 tax.py
--- a/tax.py    Sat Jul 20 21:47:01 2019 +0200
+++ b/tax.py    Fri Jul 26 09:36:25 2019 +0200
@@ -514,13 +514,23 @@
         domain=[
             ('type.statement', '=', 'balance'),
             ('closed', '!=', True),
-            ])
+            ],
+        states={
+            'invisible': Eval('type') == 'none',
+            'required': Eval('type') != 'none',
+            },
+        depends=['type'])
     credit_note_account = fields.Many2One(
         'account.account.template', 'Credit Note Account',
         domain=[
             ('type.statement', '=', 'balance'),
             ('closed', '!=', True),
-            ])
+            ],
+        states={
+            'invisible': Eval('type') == 'none',
+            'required': Eval('type') != 'none',
+            },
+        depends=['type'])
     account = fields.Many2One('account.account.template', 'Account Template',
             domain=[('parent', '=', None)], required=True)
     legal_notice = fields.Text("Legal Notice")

Reply via email to