mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Move from odoomrp-wip
This commit is contained in:
@@ -1,15 +1,84 @@
|
||||
.. 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
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To configure operation can be started without material, you need to:
|
||||
|
||||
1. Go to menu *Manufacture -> Configuration -> Routings*
|
||||
2. Open/create routing data
|
||||
3. Open/create one of the routing operation
|
||||
4. Activate *Init without material* option
|
||||
|
||||
After configuration, everytime that operation create, user can start work order without
|
||||
material assign.
|
||||
|
||||
To start work order without material assigned, you need to:
|
||||
|
||||
1. Go to menu *Manufacture -> Manufacture -> Workorder*
|
||||
2. Open/create work order
|
||||
3. Activate *Init without material* option
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
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.
|
||||
|
||||
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>
|
||||
* Pedro M. Baeza <pedro.baeza@tecnativa.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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
# -*- 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": "Tecnativa,"
|
||||
"AvanzOSC,"
|
||||
"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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
8
mrp_operations_start_without_material/tests/__init__.py
Normal file
8
mrp_operations_start_without_material/tests/__init__.py
Normal file
@@ -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
|
||||
@@ -0,0 +1,81 @@
|
||||
# -*- 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]
|
||||
|
||||
# WO can not start without material
|
||||
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")
|
||||
|
||||
# WO should start
|
||||
self.assertEqual(
|
||||
wo.state,
|
||||
"startworking")
|
||||
Reference in New Issue
Block a user