← Back to team overview

openerp-expert-accounting team mailing list archive

Closing of fiscal year, draft and valid move_lines

 

currently 5.0

charts of accounts 
* selected fiscal year
* all/posted move_lines

Account Balance report
* selected Fiscal Year
* accounts all/moves/balance not 0
 
obviously the results may be different cause chart of accounts selects all as 
default 

to get a correct balance of the current year it seems to me that all previous 
years must be closed - here in Austria the old year is open very often up to 
12 month. - result charts of accounts show incomplete numbers.

So I suggest a compatible change which sums up all open fiscal years until the 
selected year.

To Do - Charts of accounts -> double click shows "Entries"  only for the 
selected fiscal year. - should be shown for all open fy.

Please review
-- 
Best Regards

ChriCar Beteiligungs- und Beratungs- GmbH
http://www.chricar.at/ChriCar/index.html
Dr. Ferdinand Gassauer
Official Tiny Partner
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2010-03-14 11:44:58 +0000
+++ account/account_move_line.py	2010-04-21 18:30:14 +0000
@@ -29,6 +29,7 @@
 from mx.DateTime import RelativeDateTime, now, DateTime, localtime
 
 import tools
+import sys
 
 #----------------------------------------------------------------------------
 # Account Move Line
@@ -43,7 +44,15 @@
             fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
             fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0'
         else:
-            fiscalyear_clause = '%s' % context['fiscalyear']
+            # FIXME - account charts return only the selected year - and hence do not respect moves of pervious unclosed periods
+            fy_id = context.get('fiscalyear')
+            fys = fiscalyear_obj.search(cr, uid, [('id', '=', fy_id )])
+            for fy_ids in self.pool.get('account.fiscalyear').browse(cr, uid,fys):
+                fy_end_date = fy_ids.date_stop
+            fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<=', fy_end_date),('state', '=', 'draft')])
+            print >>sys.stderr, "TEST **************  fy_ids", fiscalyear_ids
+            fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0'
+            #fiscalyear_clause = '%s' % context['fiscalyear']
         state=context.get('state',False)
         where_move_state = ''
         where_move_lines_by_date = ''


Follow ups