From a6a3df3d0eda0fc2476c59de61d59534815f7c20 Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Wed, 18 Sep 2019 11:57:37 +0000 Subject: [PATCH] [FIX] account: tax lock date: don't check tax lock date when printing the invoice It made no sense; forward-port mistake. closes odoo/odoo#37071 Signed-off-by: Laurent Smet --- addons/account/models/account_move.py | 1 - addons/account/tests/test_account_move_entry.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c2df289ec50..8a6de4e1ccf 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2053,7 +2053,6 @@ class AccountMove(models.Model): """ if any(not move.is_invoice(include_receipts=True) for move in self): raise UserError(_("Only invoices could be printed.")) - self._check_tax_lock_date() self.filtered(lambda inv: not inv.invoice_sent).write({'invoice_sent': True}) if self.user_has_groups('account.group_account_invoice'): diff --git a/addons/account/tests/test_account_move_entry.py b/addons/account/tests/test_account_move_entry.py index b8e8abb4001..10a3d53a730 100644 --- a/addons/account/tests/test_account_move_entry.py +++ b/addons/account/tests/test_account_move_entry.py @@ -60,6 +60,7 @@ class TestAccountMove(InvoiceTestCommon): self.env['account.move'].create(self.test_move.copy_data()) def test_misc_tax_lock_date_1(self): + self.test_move.post() # Set the tax lock date after the journal entry date. self.test_move.company_id.tax_lock_date = fields.Date.from_string('2017-01-01')