~openerp-dev/openobject-addons/acct_prj_hr_logs

« back to all changes in this revision

Viewing changes to account/wizard/account_open_closed_fiscalyear.py

  • Committer: pap(openerp)
  • Date: 2010-06-21 05:19:03 UTC
  • mfrom: (3638.1.26 trunk-dev-addons3)
  • Revision ID: pap@tinyerp.co.in-20100621051903-lm0gpjuehqakpntg
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        if not data_fyear.end_journal_period_id:
36
36
            raise osv.except_osv(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
37
37
        period_journal = data_fyear.end_journal_period_id
38
 
        ids_move = self.pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
 
38
        ids_move = self.pool.get('account.move').search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
39
39
        if ids_move:
40
 
            cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
41
 
                    #cr.execute('UPDATE account_journal_period ' \
42
 
            #        'SET state = %s ' \
43
 
            #        'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
44
 
            #        ('draft',data_fyear))
45
 
            #cr.execute('UPDATE account_period SET state = %s ' \
46
 
            #        'WHERE fiscalyear_id = %s', ('draft',data_fyear))
47
 
            #cr.execute('UPDATE account_fiscalyear ' \
48
 
            #        'SET state = %s, end_journal_period_id = null '\
49
 
            #        'WHERE id = %s', ('draft',data_fyear))
 
40
            cr.execute('delete from account_move where id IN %s', (tuple(ids_move),))
50
41
        return {}
51
42
 
52
43
account_open_closed_fiscalyear()