changeset 6159fa4243eb in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=6159fa4243eb
description:
        Order fiscal year and period with descending start date by default

        issue10475
        review348571002
diffstat:

 fiscalyear.py |  3 ++-
 period.py     |  2 +-
 period.xml    |  1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 602ac248b0ed -r 6159fa4243eb fiscalyear.py
--- a/fiscalyear.py     Thu Jun 17 09:25:40 2021 +0200
+++ b/fiscalyear.py     Fri Jun 25 00:55:17 2021 +0200
@@ -37,6 +37,7 @@
         domain=[
             ('company', '=', Eval('company')),
             ],
+        order=[('start_date', 'ASC'), ('id', 'ASC')],
         depends=DEPENDS + ['company'])
     state = fields.Selection([
             ('open', 'Open'),
@@ -58,7 +59,7 @@
     @classmethod
     def __setup__(cls):
         super(FiscalYear, cls).__setup__()
-        cls._order.insert(0, ('start_date', 'ASC'))
+        cls._order.insert(0, ('start_date', 'DESC'))
         cls._transitions |= set((
                 ('open', 'close'),
                 ('close', 'locked'),
diff -r 602ac248b0ed -r 6159fa4243eb period.py
--- a/period.py Thu Jun 17 09:25:40 2021 +0200
+++ b/period.py Fri Jun 25 00:55:17 2021 +0200
@@ -58,7 +58,7 @@
     def __setup__(cls):
         super(Period, cls).__setup__()
         cls.__access__.add('fiscalyear')
-        cls._order.insert(0, ('start_date', 'ASC'))
+        cls._order.insert(0, ('start_date', 'DESC'))
         cls._transitions |= set((
                 ('open', 'close'),
                 ('close', 'locked'),
diff -r 602ac248b0ed -r 6159fa4243eb period.xml
--- a/period.xml        Thu Jun 17 09:25:40 2021 +0200
+++ b/period.xml        Fri Jun 25 00:55:17 2021 +0200
@@ -74,6 +74,7 @@
             <field name="res_model">account.period</field>
             <field name="search_value"
                 eval="[('state', '=', 'open')]" pyson="1"/>
+            <field name="order" eval="[('start_date', 'ASC'), ('id', 'ASC')]" 
pyson="1"/>
         </record>
         <record model="ir.action.act_window.view"
             id="act_period_form_close_view1">

Reply via email to