From 64bbf7eefbba00cf1c17caa1733a8c174ca92bdc Mon Sep 17 00:00:00 2001 From: Rifakat Date: Wed, 2 May 2012 18:54:43 +0530 Subject: [PATCH 1/2] [FIX] account_voucher: force date and period update on voucher when confirming bank statement + take statement date as default statement line date bzr revid: rha@tinyerp.com-20120502132443-f8hqcr9lq053lu1t --- addons/account_voucher/account_voucher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 5b9726c7fab..88e00f7b8b5 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1421,7 +1421,11 @@ class account_bank_statement(osv.osv): bank_st_line_obj = self.pool.get('account.bank.statement.line') st_line = bank_st_line_obj.browse(cr, uid, st_line_id, context=context) if st_line.voucher_id: - voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context) + voucher_obj.write(cr, uid, [st_line.voucher_id.id], + {'number': next_number, + 'date': st_line.date, + 'period_id': st_line.statement_id.period_id.id}, + context=context) if st_line.voucher_id.state == 'cancel': voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context) wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr) From 80daf3679bcdc593f8323cd814949b2e84f03e18 Mon Sep 17 00:00:00 2001 From: Rifakat Date: Thu, 3 May 2012 18:26:34 +0530 Subject: [PATCH 2/2] account_voucher: Used bank's statement date into stataement line date when importing invoices through Import Invocies button bzr revid: rha@tinyerp.com-20120503125634-f172kky9g2d4mvyt --- addons/account_voucher/wizard/account_statement_from_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index 1b921e0ccf4..2fb6673d652 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -112,7 +112,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): 'statement_id': statement_id, 'ref': line.ref, 'voucher_id': voucher_id, - 'date': time.strftime('%Y-%m-%d'), #time.strftime('%Y-%m-%d'), #line.date_maturity or, + 'date': statement.date, }, context=context) return {'type': 'ir.actions.act_window_close'}