mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-18 14:21:59 +02:00
Move 124 sale modules to oca-sale, create oca-project with 56 project modules from oca-workflow-process
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9eb7ae5807
commit
6094c218b2
2332 changed files with 125826 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_project_task_code
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
# Copyright 2016 Tecnativa <vicent.cubells@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import odoo.tests.common as common
|
||||
|
||||
|
||||
class TestProjectTaskCode(common.TransactionCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.project_task_model = self.env["project.task"]
|
||||
self.ir_sequence_model = self.env["ir.sequence"]
|
||||
self.task_sequence = self.env.ref("project_task_code.sequence_task")
|
||||
self.project_task = self.env.ref("project.project_1_task_1")
|
||||
|
||||
def test_old_task_code_assign(self):
|
||||
project_tasks = self.project_task_model.search([])
|
||||
for project_task in project_tasks:
|
||||
self.assertNotEqual(project_task.code, "/")
|
||||
|
||||
def test_new_task_code_assign(self):
|
||||
number_next = self.task_sequence.number_next_actual
|
||||
code = self.task_sequence.get_next_char(number_next)
|
||||
project_task = self.project_task_model.create(
|
||||
{
|
||||
"name": "Testing task code",
|
||||
}
|
||||
)
|
||||
self.assertNotEqual(project_task.code, "/")
|
||||
self.assertEqual(project_task.code, code)
|
||||
|
||||
def test_name_get(self):
|
||||
number_next = self.task_sequence.number_next_actual
|
||||
code = self.task_sequence.get_next_char(number_next)
|
||||
project_task = self.project_task_model.create(
|
||||
{
|
||||
"name": "Task Testing Get Name",
|
||||
}
|
||||
)
|
||||
result = project_task.name_get()
|
||||
self.assertEqual(result[0][1], "[%s] Task Testing Get Name" % code)
|
||||
|
||||
def test_name_search(self):
|
||||
project_task = self.env["project.task"].create(
|
||||
{"name": "Such Much Task", "code": "TEST-123"}
|
||||
)
|
||||
|
||||
result = project_task.name_search("TEST-123")
|
||||
self.assertIn(
|
||||
project_task.id,
|
||||
map(lambda x: x[0], result),
|
||||
f"Task with code {project_task.code} should be in the results",
|
||||
)
|
||||
|
||||
result = project_task.name_search("TEST")
|
||||
self.assertIn(
|
||||
project_task.id,
|
||||
map(lambda x: x[0], result),
|
||||
f"Task with code {project_task.code} should be in the results",
|
||||
)
|
||||
|
||||
result = project_task.name_search("much")
|
||||
self.assertIn(
|
||||
project_task.id,
|
||||
map(lambda x: x[0], result),
|
||||
f"Task with code {project_task.code} should be in the results",
|
||||
)
|
||||
|
||||
result = project_task.name_search("20232")
|
||||
self.assertNotIn(
|
||||
project_task.id,
|
||||
map(lambda x: x[0], result),
|
||||
f"Task with code {project_task.code} should not be in the results",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue