diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index c9516b6135f..e1c95fa1f8f 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1605,7 +1605,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) voucher_obj.signal_proforma_voucher(cr, uid, [st_line.voucher_id.id]) diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index de5121a819b..059989801d1 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -94,7 +94,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): 'account_id': result['value'].get('account_id', statement.journal_id.default_credit_account_id.id), 'company_id': statement.company_id.id, 'currency_id': statement.currency.id, - 'date': line.date, + 'date': statement.date, 'amount': sign*amount, 'payment_rate': result['value']['payment_rate'], 'payment_rate_currency_id': result['value']['payment_rate_currency_id'], @@ -119,7 +119,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'), + 'date': statement.date, }, context=context) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 5266147fef0..8b93e2a9bb6 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -111,9 +111,6 @@ class procurement_order(osv.osv): bom_result = production_obj.action_compute(cr, uid, [produce_id], properties=[x.id for x in procurement.property_ids]) production_obj.signal_button_confirm(cr, uid, [produce_id]) - if res_id: - move_obj.write(cr, uid, [res_id], - {'location_id': procurement.location_id.id}) self.production_order_create_note(cr, uid, ids, context=context) return res