← Back to team overview

credativ team mailing list archive

[Branch ~credativ/openobject-addons/6.1] Rev 7045: [Merge] Accounting period not sorting

 

Merge authors:
  Kinner Vachhani (kinner-vachhani)
Related merge proposals:
  https://code.launchpad.net/~credativ/openobject-addons/6.1-fix-lp1190773/+merge/169452
  proposed by: Kinner Vachhani (kinner-vachhani)
  review: Approve - Kinner Vachhani (kinner-vachhani)
------------------------------------------------------------
revno: 7045 [merge]
committer: Kinner Vachhani <kin.vachhani@xxxxxxxxx>
branch nick: credativ-openobject
timestamp: Fri 2013-07-05 11:04:15 +0100
message:
  [Merge] Accounting period not sorting
modified:
  account/wizard/account_chart.py


--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1

Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'account/wizard/account_chart.py'
--- account/wizard/account_chart.py	2011-10-27 21:11:24 +0000
+++ account/wizard/account_chart.py	2013-06-14 14:22:32 +0000
@@ -51,7 +51,7 @@
                                FROM account_period p
                                LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
                                WHERE f.id = %s
-                               ORDER BY p.date_start ASC
+                               ORDER BY p.date_start ASC, p.special DESC
                                LIMIT 1) AS period_start
                 UNION ALL
                 SELECT * FROM (SELECT p.id
@@ -59,7 +59,7 @@
                                LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
                                WHERE f.id = %s
                                AND p.date_start < NOW()
-                               ORDER BY p.date_stop DESC
+                               ORDER BY p.date_stop DESC, p.special DESC
                                LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id))
             periods =  [i[0] for i in cr.fetchall()]
             if periods and len(periods) > 1: