Skip to content

Commit

Permalink
Move from odoomrp-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Aug 6, 2016
1 parent 62f0eeb commit 8992070
Show file tree
Hide file tree
Showing 10 changed files with 183 additions and 41 deletions.
72 changes: 71 additions & 1 deletion mrp_operations_start_without_material/README.rst
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.
9 changes: 5 additions & 4 deletions mrp_operations_start_without_material/__init__.py
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
33 changes: 9 additions & 24 deletions mrp_operations_start_without_material/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
##############################################################################
# © 2015 Daniel Campos
# © 2015 Pedro M. Baeza
# © 2015 Ana Juaristi
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'MRP Operations start without material',
'version': '8.0.1.0.1',
'author': 'OdooMRP team',
'contributors': ["Daniel Campos <danielcampos@avanzosc.es>",
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
"Ana Juaristi <ajuaristio@gmail.com>"],
'website': 'http://www.odoomrp.com',
"depends": ['mrp_operations_extension'],
"name": "MRP Operations start without material",
"version": "8.0.1.0.1",
"author": "OdooMRP team,Odoo Community Association (OCA)",
"website": "http://www.odoomrp.com",
"depends": ["mrp_operations_extension"],
"category": "Manufacturing",
"data": ['views/mrp_routing_view.xml',
'views/mrp_production_view.xml'
Expand Down
7 changes: 4 additions & 3 deletions mrp_operations_start_without_material/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- 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 mrp_routing
from . import mrp_production
Expand Down
7 changes: 4 additions & 3 deletions mrp_operations_start_without_material/models/mrp_bom.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- 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 openerp import models, api

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- 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 openerp import models, fields

Expand Down
7 changes: 4 additions & 3 deletions mrp_operations_start_without_material/models/mrp_routing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- 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 openerp import models, fields

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions mrp_operations_start_without_material/tests/__init__.py
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 mrp_operations_start_without_material/tests/test_mrp_operation.py
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")

0 comments on commit 8992070

Please sign in to comment.