[NEW] contract_fix_compute_journal_id
This commit is contained in:
1
contract_fix_compute_journal_id/tests/__init__.py
Normal file
1
contract_fix_compute_journal_id/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_contract
|
25
contract_fix_compute_journal_id/tests/test_contract.py
Normal file
25
contract_fix_compute_journal_id/tests/test_contract.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from odoo.addons.contract.tests.test_contract import TestContractBase
|
||||
|
||||
|
||||
class TestContract(TestContractBase):
|
||||
def test_compute_journal_id(self):
|
||||
self.contract.contract_template_id = self.template
|
||||
self.contract._compute_journal_id()
|
||||
self.assertEqual(self.contract.journal_id, self.template.journal_id)
|
||||
|
||||
new_journal = self.env["account.journal"].create(
|
||||
{
|
||||
"name": "Test journal",
|
||||
"code": "foo",
|
||||
"type": "sale",
|
||||
}
|
||||
)
|
||||
new_template = self.env["contract.template"].create(
|
||||
{
|
||||
"name": "Test Contract Template Journal ID",
|
||||
"journal_id": new_journal.id,
|
||||
}
|
||||
)
|
||||
self.contract.contract_template_id = new_template
|
||||
self.contract._compute_journal_id()
|
||||
self.assertEqual(self.contract.journal_id, new_template.journal_id)
|
Reference in New Issue
Block a user