summaryrefslogtreecommitdiff
path: root/addons/l10n_ch
diff options
context:
space:
mode:
authorwilliam <wan@odoo.com>2020-03-30 11:46:27 +0000
committerwilliam <wan@odoo.com>2020-08-05 11:57:10 +0000
commit82dc0cb7b91ae59beae7e1c865b670afc5958b31 (patch)
tree949b949b249cdac265310798d5abb82675a1741b /addons/l10n_ch
parent276ba8e90c87f8294286f915508766761a58d1e2 (diff)
[IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling post() on it, but rather set it to be auto-posted at accounting date. This is useful when we are creating a lot of entries in batch and some might be in the future, some in the past, and we don't want to separate that in two batch every time. (asset, accrual, transfer,... )
Diffstat (limited to 'addons/l10n_ch')
-rw-r--r--addons/l10n_ch/tests/test_l10n_ch_isr_print.py4
-rw-r--r--addons/l10n_ch/tests/test_swissqr.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/l10n_ch/tests/test_l10n_ch_isr_print.py b/addons/l10n_ch/tests/test_l10n_ch_isr_print.py
index bd568636706..9bdba9b7d0a 100644
--- a/addons/l10n_ch/tests/test_l10n_ch_isr_print.py
+++ b/addons/l10n_ch/tests/test_l10n_ch_isr_print.py
@@ -52,7 +52,7 @@ class ISRTest(AccountTestInvoicingCommon):
'invoice_date': '2019-01-01',
'invoice_line_ids': [(0, 0, {'product_id': self.product_a.id})],
})
- invoice_chf.post()
+ invoice_chf.action_post()
self.assertTrue(self.print_isr(invoice_chf))
invoice_eur = self.env['account.move'].create({
@@ -63,5 +63,5 @@ class ISRTest(AccountTestInvoicingCommon):
'invoice_date': '2019-01-01',
'invoice_line_ids': [(0, 0, {'product_id': self.product_a.id})],
})
- invoice_eur.post()
+ invoice_eur.action_post()
self.assertFalse(self.print_isr(invoice_eur))
diff --git a/addons/l10n_ch/tests/test_swissqr.py b/addons/l10n_ch/tests/test_swissqr.py
index 8976f990097..42e7830e301 100644
--- a/addons/l10n_ch/tests/test_swissqr.py
+++ b/addons/l10n_ch/tests/test_swissqr.py
@@ -156,7 +156,7 @@ class TestSwissQR(AccountTestInvoicingCommon):
def test_swissQR_missing_bank(self):
# Let us test the generation of a SwissQR for an invoice, first by showing an
# QR is included in the invoice is only generated when Odoo has all the data it needs.
- self.invoice1.post()
+ self.invoice1.action_post()
self.swissqr_not_generated(self.invoice1)
def test_swissQR_iban(self):
@@ -164,7 +164,7 @@ class TestSwissQR(AccountTestInvoicingCommon):
# Here we don't use a structured reference
iban_account = self.create_account(CH_IBAN)
self.invoice1.partner_bank_id = iban_account
- self.invoice1.post()
+ self.invoice1.action_post()
self.swissqr_generated(self.invoice1, ref_type="NON")
def test_swissQR_qriban(self):
@@ -172,5 +172,5 @@ class TestSwissQR(AccountTestInvoicingCommon):
qriban_account = self.create_account(QR_IBAN)
self.assertTrue(qriban_account.acc_type, 'qr-iban')
self.invoice1.partner_bank_id = qriban_account
- self.invoice1.post()
+ self.invoice1.action_post()
self.swissqr_generated(self.invoice1, ref_type="QRR")