From 64bbf7eefbba00cf1c17caa1733a8c174ca92bdc Mon Sep 17 00:00:00 2001 From: Rifakat Date: Wed, 2 May 2012 18:54:43 +0530 Subject: [PATCH] [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)