From b44cb82c1b72233ddbf0d325d273b0a7e3076e7f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 31 Mar 2016 13:45:17 +0200 Subject: [PATCH] [FIX] account, stock: date invoice for a refund When a a refund is created from an open invoice and a different date than today is selected as refund date, the invoice date of this refund must be the selected date. opw:673369 --- addons/account/wizard/account_invoice_refund.py | 2 +- addons/stock_account/stock_account.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 9456c381817..226b3e711f8 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -92,7 +92,7 @@ class AccountInvoiceRefund(models.TransientModel): tax_lines = inv_obj._refund_cleanup_lines(tax_lines) invoice.update({ 'type': inv.type, - 'date_invoice': date, + 'date_invoice': form.date_invoice, 'state': 'draft', 'number': False, 'invoice_line_ids': invoice_lines, diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index f4004b824d6..68d081ad8de 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -106,7 +106,7 @@ class account_invoice(osv.osv): return [] def _prepare_refund(self, cr, uid, invoice, date_invoice=None, date=None, description=None, journal_id=None, context=None): - invoice_data = super(account_invoice, self)._prepare_refund(cr, uid, invoice, date, date, + invoice_data = super(account_invoice, self)._prepare_refund(cr, uid, invoice, date_invoice, date, description, journal_id, context=context) #for anglo-saxon accounting if invoice.company_id.anglo_saxon_accounting and invoice.type == 'in_invoice':