[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:
@@ -92,7 +92,7 @@ class AccountInvoiceRefund(models.TransientModel):
|
|||||||
tax_lines = inv_obj._refund_cleanup_lines(tax_lines)
|
tax_lines = inv_obj._refund_cleanup_lines(tax_lines)
|
||||||
invoice.update({
|
invoice.update({
|
||||||
'type': inv.type,
|
'type': inv.type,
|
||||||
'date_invoice': date,
|
'date_invoice': form.date_invoice,
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
'number': False,
|
'number': False,
|
||||||
'invoice_line_ids': invoice_lines,
|
'invoice_line_ids': invoice_lines,
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class account_invoice(osv.osv):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
def _prepare_refund(self, cr, uid, invoice, date_invoice=None, date=None, description=None, journal_id=None, context=None):
|
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)
|
description, journal_id, context=context)
|
||||||
#for anglo-saxon accounting
|
#for anglo-saxon accounting
|
||||||
if invoice.company_id.anglo_saxon_accounting and invoice.type == 'in_invoice':
|
if invoice.company_id.anglo_saxon_accounting and invoice.type == 'in_invoice':
|
||||||
|
|||||||
Reference in New Issue
Block a user