diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 94c4acf24aa..cdb692f454a 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -47,11 +47,8 @@ class account_move_line(osv.osv): if not context.get('fiscalyear', False): fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')]) else: - if initial_bal: - fiscalyear_date_start = fiscalyear_obj.read(cr, uid, context['fiscalyear'], ['date_start'])['date_start'] - fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<', fiscalyear_date_start), ('state', '=', 'draft')], context=context) - else: - fiscalyear_ids = [context['fiscalyear']] + #for initial balance as well as for normal query, we check only the selected FY because the best practice is to generate the FY opening entries + fiscalyear_ids = [context['fiscalyear']] fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0' state = context.get('state', False) @@ -1264,4 +1261,4 @@ class account_move_line(osv.osv): account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: