mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
================================== MRP Project Link (with operations) ================================== This module links manufacturing operations with projects. It performs the following actions: * Auto-create tasks for work orders with assigned operators. * Add a tab where to encode task for the work order. * Add a link on task for the work order scheduled product. Installation ============ This modules is auto-installed when you install *mrp_operations_extension* and *mrp_project*. Usage ===== In a manufacturing order (MO) containing work orders with at least one operator assigned, when a work order is started, a task is created and assigned to the operator. In the work order form, a new tab "Operators time" is added to input the the work log. Besides, in the related tasks, the products scheduled in the work order are listed.
48 lines
1.7 KiB
Python
48 lines
1.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
# (c) 2015 Pedro M. Baeza - Serv. Tecnol. Avanzados
|
|
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
from openerp.addons.mrp_project.tests import test_mrp_project
|
|
|
|
|
|
class TestMrpOperationsProject(test_mrp_project.TestMrpProject):
|
|
def setUp(self):
|
|
super(TestMrpOperationsProject, self).setUp()
|
|
self.workcenter = self.env['mrp.workcenter'].create(
|
|
{'name': 'Test work center'})
|
|
self.routing = self.env['mrp.routing'].create(
|
|
{
|
|
'name': 'Test routing',
|
|
'workcenter_lines': [
|
|
(0, 0, {'name': 'Test workcenter line',
|
|
'do_production': True,
|
|
'workcenter_id': self.workcenter.id})],
|
|
})
|
|
self.production.routing_id = self.routing.id
|
|
|
|
def test_workcenter_tasks(self):
|
|
self.workcenter.op_number = 1
|
|
self.production.signal_workflow('button_confirm')
|
|
self.production.force_production()
|
|
# start the MO (and this starts the first WO)
|
|
self.assertFalse(self.production.project_id.task_ids)
|
|
self.production.signal_workflow('button_produce')
|
|
self.assertEqual(len(self.production.workcenter_lines[0].task_m2m), 1)
|
|
self.assertEqual(len(self.production.project_id.task_ids), 2)
|
|
|
|
def test_project_full(self):
|
|
"""Don't repeat this test."""
|
|
pass
|
|
|
|
def test_preservation_project_with_works(self):
|
|
"""Don't repeat this test."""
|
|
pass
|
|
|
|
def test_onchange_task(self):
|
|
"""Don't repeat this test."""
|
|
pass
|
|
|
|
def test_button_end_work(self):
|
|
"""Don't repeat this test."""
|
|
pass
|