[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
This commit is contained in:
Goffin Simon
2016-03-31 14:18:02 +02:00
parent 81748478bc
commit b44cb82c1b
2 changed files with 2 additions and 2 deletions
@@ -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,
+1 -1
View File
@@ -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':