changeset c57340cb7d4f in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=c57340cb7d4f
description:
        Hide closed period when manually creating moves

        issue8634
        review280081003
diffstat:

 move.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 4cc6cceb9b2f -r c57340cb7d4f move.py
--- a/move.py   Sat Sep 07 23:45:08 2019 +0200
+++ b/move.py   Thu Sep 12 18:44:47 2019 +0200
@@ -59,8 +59,12 @@
     period = fields.Many2One('account.period', 'Period', required=True,
         domain=[
             ('company', '=', Eval('company', -1)),
+            If(Eval('state') == 'draft',
+                ('state', '=', 'open'),
+                ()),
             ],
-        states=_MOVE_STATES, depends=_MOVE_DEPENDS + ['company'], select=True)
+        states=_MOVE_STATES, depends=_MOVE_DEPENDS + ['company', 'state'],
+        select=True)
     journal = fields.Many2One('account.journal', 'Journal', required=True,
             states=_MOVE_STATES, depends=_MOVE_DEPENDS)
     date = fields.Date('Effective Date', required=True, select=True,

Reply via email to