[IMP] account_usability_misc: do not hide bank statement lines creation buttons
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m31s
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m31s
This commit is contained in:
@@ -23,18 +23,6 @@ class TestBankStatementLineCreation(TransactionCase):
|
||||
default_journal_id=self.bank_journal.id
|
||||
).default_get(["journal_id", "amount", "payment_ref"])
|
||||
|
||||
def test_create_blocks_creation_when_not_allowed(self):
|
||||
"""Test that create raises UserError when creation is not allowed."""
|
||||
self.bank_journal.allow_bank_statement_line_creation = False
|
||||
|
||||
with self.assertRaises(UserError):
|
||||
self.env["account.bank.statement.line"].create({
|
||||
"journal_id": self.bank_journal.id,
|
||||
"amount": 100.0,
|
||||
"payment_ref": "Test",
|
||||
"date": "2024-01-01",
|
||||
})
|
||||
|
||||
def test_default_get_allows_creation_when_allowed(self):
|
||||
"""Test that default_get works when creation is allowed."""
|
||||
self.bank_journal.allow_bank_statement_line_creation = True
|
||||
@@ -45,16 +33,3 @@ class TestBankStatementLineCreation(TransactionCase):
|
||||
).default_get(["journal_id", "amount", "payment_ref"])
|
||||
|
||||
self.assertIsInstance(result, dict)
|
||||
|
||||
def test_create_allows_creation_when_allowed(self):
|
||||
"""Test that create works when creation is allowed."""
|
||||
self.bank_journal.allow_bank_statement_line_creation = True
|
||||
|
||||
line = self.env["account.bank.statement.line"].create({
|
||||
"journal_id": self.bank_journal.id,
|
||||
"amount": 100.0,
|
||||
"payment_ref": "Test",
|
||||
"date": "2024-01-01",
|
||||
})
|
||||
|
||||
self.assertTrue(line.exists())
|
||||
|
||||
Reference in New Issue
Block a user