[FIX] account: fix test for 2020
When an invoice is duplicated, the `invoice_date` is not carried over. If the field is not set, it will be set at posting at the current date. closes odoo/odoo#42622 X-original-commit: 135d3db7b9b222be198e91235657bbef77d2f69b Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -823,7 +823,10 @@ class TestAccountMoveInInvoiceOnchanges(AccountTestInvoicingCommon):
|
||||
|
||||
self.assertRecordValues(self.invoice, [{'name': 'BILL/2019/0042'}])
|
||||
|
||||
invoice_copy = self.invoice.copy()
|
||||
values = {
|
||||
'invoice_date': self.invoice.invoice_date,
|
||||
}
|
||||
invoice_copy = self.invoice.copy(default=values)
|
||||
invoice_copy.post()
|
||||
|
||||
self.assertRecordValues(invoice_copy, [{'name': 'BILL/2019/0043'}])
|
||||
|
||||
@@ -823,7 +823,10 @@ class TestAccountMoveInRefundOnchanges(AccountTestInvoicingCommon):
|
||||
|
||||
self.assertRecordValues(self.invoice, [{'name': 'RBILL/2019/0042'}])
|
||||
|
||||
invoice_copy = self.invoice.copy()
|
||||
values = {
|
||||
'invoice_date': self.invoice.invoice_date,
|
||||
}
|
||||
invoice_copy = self.invoice.copy(default=values)
|
||||
invoice_copy.post()
|
||||
|
||||
self.assertRecordValues(invoice_copy, [{'name': 'RBILL/2019/0043'}])
|
||||
|
||||
@@ -967,7 +967,10 @@ class TestAccountMoveOutInvoiceOnchanges(AccountTestInvoicingCommon):
|
||||
|
||||
self.assertRecordValues(self.invoice, [{'name': 'INV/2019/0042'}])
|
||||
|
||||
invoice_copy = self.invoice.copy()
|
||||
values = {
|
||||
'invoice_date': self.invoice.invoice_date,
|
||||
}
|
||||
invoice_copy = self.invoice.copy(default=values)
|
||||
invoice_copy.post()
|
||||
|
||||
self.assertRecordValues(invoice_copy, [{'name': 'INV/2019/0043'}])
|
||||
|
||||
@@ -823,7 +823,10 @@ class TestAccountMoveOutRefundOnchanges(AccountTestInvoicingCommon):
|
||||
|
||||
self.assertRecordValues(self.invoice, [{'name': 'RINV/2019/0042'}])
|
||||
|
||||
invoice_copy = self.invoice.copy()
|
||||
values = {
|
||||
'invoice_date': self.invoice.invoice_date,
|
||||
}
|
||||
invoice_copy = self.invoice.copy(default=values)
|
||||
invoice_copy.post()
|
||||
|
||||
self.assertRecordValues(invoice_copy, [{'name': 'RINV/2019/0043'}])
|
||||
|
||||
Reference in New Issue
Block a user