| 1 |
|
| 2 |
|
| 3 |
from odoo.addons.sale_mrp.tests.test_multistep_manufacturing import TestMultistepManufacturing |
| 4 |
from odoo.tests import common |
| 5 |
|
| 6 |
|
| 7 |
@common.tagged('post_install', '-at_install') |
| 8 |
class TestSaleMrpAccount(TestMultistepManufacturing): |
| 9 |
def test_mo_get_project_from_so(self): |
| 10 |
""" ensure the project of MO is inherited from the SO if no project is set """ |
| 11 |
project = self.env['project.project'].create({ |
| 12 |
'name': 'SO Project', |
| 13 |
}) |
| 14 |
self.sale_order.project_id = project |
| 15 |
self.assertFalse(self.sale_order.mrp_production_ids.project_id) |
| 16 |
self.sale_order.action_confirm() |
| 17 |
self.assertEqual(self.sale_order.mrp_production_ids.project_id, project) |