changeset 3c407f216555 in modules/sale_subscription:default
details: 
https://hg.tryton.org/modules/sale_subscription?cmd=changeset&node=3c407f216555
description:
        Display next invoice date on subscription form

        issue11267
        review376861002
diffstat:

 subscription.py            |  7 ++++++-
 view/subscription_form.xml |  6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 54d77055793b -r 3c407f216555 subscription.py
--- a/subscription.py   Tue Feb 15 00:08:47 2022 +0100
+++ b/subscription.py   Sun Mar 20 01:34:39 2022 +0100
@@ -143,7 +143,12 @@
                 | Eval('next_invoice_date')),
             },
         depends=['state', 'next_invoice_date'])
-    next_invoice_date = fields.Date("Next Invoice Date", readonly=True)
+    next_invoice_date = fields.Date(
+        "Next Invoice Date", readonly=True,
+        states={
+            'invisible': Eval('state') != 'running',
+            },
+        depends=['state'])
 
     lines = fields.One2Many(
         'sale.subscription.line', 'subscription', "Lines",
diff -r 54d77055793b -r 3c407f216555 view/subscription_form.xml
--- a/view/subscription_form.xml        Tue Feb 15 00:08:47 2022 +0100
+++ b/view/subscription_form.xml        Sun Mar 20 01:34:39 2022 +0100
@@ -27,7 +27,11 @@
             <label name="end_date"/>
             <field name="end_date"/>
             <label name="invoice_start_date"/>
-            <field name="invoice_start_date"/>
+            <group col="-1" id="invoice_dates">
+                <field name="invoice_start_date"/>
+                <label name="next_invoice_date"/>
+                <field name="next_invoice_date"/>
+            </group>
             <label name="invoice_recurrence"/>
             <field name="invoice_recurrence"/>
             <label name="payment_term"/>

Reply via email to