~mikel-martin/openerp-spain/6.1

« back to all changes in this revision

Viewing changes to l10n_es_fiscal_year_closing/fyc.py

  • Committer: mikel
  • Date: 2014-05-27 01:40:55 UTC
  • mfrom: (303.1.93 openerp-spain)
  • Revision ID: mikel@hide-20140527014055-7l9u7rjdw84ete1i
MERGE

Show diffs side-by-side

added added

removed removed

Lines of Context:
644
644
                #       reconcile option of an account in the future)
645
645
                #
646
646
                netsvc.Logger().notifyChannel('fyc', netsvc.LOG_DEBUG, "Reconcile %s" % move.ref)
647
 
                tmp_context = context.copy()
648
 
                tmp_context['fy_closing'] = True # Fiscal year closing = reconcile everything
649
647
                line_ids = [line.id for line in move.line_id]
650
 
                self.pool.get('account.move.line').reconcile(cr, uid, line_ids, context=tmp_context)
651
 
 
 
648
                r_id = self.pool['account.move.reconcile'].create(cr, uid,
 
649
                                            {'type': 'auto', 
 
650
                                             'opening_reconciliation': True})
 
651
                cr.execute("""UPDATE account_move_line 
 
652
                              SET reconcile_id = %s 
 
653
                              WHERE id in %s""",
 
654
                              (r_id, tuple(line_ids),))
652
655
            #
653
656
            # Close the fiscal year and it's periods
654
657
            #