From 342ff9db57a9902e6d6fa3d1d5d000662292c4e0 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 30 Sep 2010 12:36:01 +0530 Subject: [PATCH] [FIX] Account voucher: Did not create move_ids on bank statement lines when we confirm the bank statements bzr revid: mra@mra-laptop-20100930070601-6bz0ozmgfbm265xp --- addons/account/account_bank_statement.py | 2 +- addons/account_voucher/account_voucher.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index bad736e4967..ba930c7e01e 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -375,7 +375,7 @@ class account_bank_statement(osv.osv): if not st_line.amount: continue st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context) - self.create_move_from_st_line(cr, uid, st_line, company_currency_id, st_line_number, context) + self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context) self.write(cr, uid, [st.id], {'name': st_number}, context=context) self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st_number) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 29fe1b0b92d..6994081ec84 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -568,6 +568,7 @@ class account_voucher(osv.osv): analytic_pool = self.pool.get('account.analytic.line') currency_pool = self.pool.get('res.currency') invoice_pool = self.pool.get('account.invoice') + bank_st_line_obj = self.pool.get('account.bank.statement.line') for inv in self.browse(cr, uid, ids): if inv.move_id: continue @@ -587,6 +588,11 @@ class account_voucher(osv.osv): 'period_id': inv.period_id and inv.period_id.id or False } move_id = move_pool.create(cr, uid, move) + line_bank_ids = bank_st_line_obj.search(cr, uid, [('voucher_id', '=', inv.id)], context=context) + if line_bank_ids: + bank_st_line_obj.write(cr, uid, line_bank_ids, { + 'move_ids': [(4, move_id, False)] + }) #create the first line manually company_currency = inv.journal_id.company_id.currency_id.id