-
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
183 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,85 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:alt: License: AGPL-3 | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
===================================== | ||
MRP Operations start without material | ||
===================================== | ||
|
||
This module allows to start WO without having the material assigned. | ||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
1. Clone the branch 8.0 of the repository https://github.com/OCA/manufacture | ||
2. Add the path to this repository in your configuration (addons-path) | ||
3. Update the module list | ||
4. Go to menu *Setting -> Modules -> Local Modules* | ||
5. Search For *MRP Operations start without material* | ||
6. Install the module | ||
|
||
Configuration | ||
============= | ||
|
||
No configuration needed | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
* Go to ... | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/129/8.0 | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/manufacture/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed `feedback | ||
<https://github.com/OCA/ | ||
manufacture/issues/new?body=module:%20 | ||
mrp_operations_start_without_material%0Aversion:%20 | ||
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Daniel Campos <danielcampos@avanzosc.es> | ||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> | ||
* Ana Juaristi <ajuaristio@gmail.com> | ||
* OpenSynergy Indonesia <https://opensynergy-indonesia.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# For copyright and license notices, see __openerp__.py file in root directory | ||
############################################################################## | ||
# © 2015 Daniel Campos | ||
# © 2015 Pedro M. Baeza | ||
# © 2015 Ana Juaristi | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import models | ||
from . import models, tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
mrp_operations_start_without_material/models/mrp_production.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015 Daniel Campos | ||
# © 2015 Pedro M. Baeza | ||
# © 2015 Ana Juaristi | ||
# © 2016 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import test_mrp_operation |
74 changes: 74 additions & 0 deletions
74
mrp_operations_start_without_material/tests/test_mrp_operation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015 Daniel Campos | ||
# © 2015 Pedro M. Baeza | ||
# © 2015 Ana Juaristi | ||
# © 2016 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp.tests.common import TransactionCase | ||
from datetime import datetime | ||
from openerp import exceptions | ||
|
||
|
||
class TestOperation(TransactionCase): | ||
|
||
def setUp(self, *args, **kwargs): | ||
result = super(TestOperation, self).setUp(*args, **kwargs) | ||
|
||
self.obj_production = self.env["mrp.production"] | ||
|
||
self.location = self.env.ref("stock.stock_location_14") | ||
self.bom = self.env.ref("mrp.mrp_bom_11") | ||
self.routing = self.env.ref("mrp.mrp_routing_1") | ||
self.product = self.env.ref("product.product_product_4b") | ||
self.routing_wc = self.env.ref("mrp.mrp_routing_workcenter_4") | ||
# self.routning_wc.write({"init_without_material": True}) | ||
|
||
self.prod_data = { | ||
"date_planned": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), | ||
"location_dest_id": self.location.id, | ||
"location_src_id": self.location.id, | ||
"product_id": self.product.id, | ||
"product_qty": 1.0, | ||
"product_uom": self.product.uom_id.id, | ||
"bom_id": self.bom.id, | ||
"routing_id": self.routing.id, | ||
} | ||
|
||
return result | ||
|
||
def test_1(self): | ||
production = self.obj_production.create(self.prod_data) | ||
production.signal_workflow("button_confirm") | ||
|
||
# MO should be in Confirm state | ||
self.assertEqual( | ||
production.state, | ||
"confirmed") | ||
|
||
# MO should have equal operation as routing workcenter | ||
self.assertEqual( | ||
len(production.workcenter_lines), | ||
len(self.routing.workcenter_lines)) | ||
|
||
wo = production.workcenter_lines[0] | ||
with self.assertRaises(exceptions.Warning): | ||
wo.signal_workflow("button_start_working") | ||
|
||
def test_2(self): | ||
self.routing.workcenter_lines.write({ | ||
"init_without_material": True}) | ||
production = self.obj_production.create(self.prod_data) | ||
production.signal_workflow("button_confirm") | ||
# MO should be in Confirm state | ||
self.assertEqual( | ||
production.state, | ||
"confirmed") | ||
|
||
# MO should have equal operation as routing workcenter | ||
self.assertEqual( | ||
len(production.workcenter_lines), | ||
len(self.routing.workcenter_lines)) | ||
|
||
wo = production.workcenter_lines[0] | ||
wo.signal_workflow("button_start_working") |