diff --git a/procurement_mrp_no_confirm/README.rst b/procurement_mrp_no_confirm/README.rst index 8bbb986c7..994db3356 100644 --- a/procurement_mrp_no_confirm/README.rst +++ b/procurement_mrp_no_confirm/README.rst @@ -1,12 +1,76 @@ + .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=============================== Don't confirm MOs when procured =============================== This module prevents the automatic confirmation of manufacturing order when procurement orders are executed. +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 *Procurement MRP no Confirm* +6. Install the module + +Usage +===== + +.. 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 ====================== * If the production order workflow has been altered in the transition *prod_trans_draft_picking* to have another condition, when uninstalling this module, you will need to restore the custom condition. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Contributors +------------ + +* Pedro M. Baeza +* Ainara Galdona +* Oihane Crucelaegui +* Andhitia Rama + +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. diff --git a/procurement_mrp_no_confirm/__init__.py b/procurement_mrp_no_confirm/__init__.py index d218bdefe..87f9041b3 100644 --- a/procurement_mrp_no_confirm/__init__.py +++ b/procurement_mrp_no_confirm/__init__.py @@ -1,20 +1,7 @@ -# -*- encoding: 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models from openerp import SUPERUSER_ID, api diff --git a/procurement_mrp_no_confirm/__openerp__.py b/procurement_mrp_no_confirm/__openerp__.py index 03d3c0526..17ecb3835 100644 --- a/procurement_mrp_no_confirm/__openerp__.py +++ b/procurement_mrp_no_confirm/__openerp__.py @@ -1,32 +1,19 @@ -# -*- encoding: 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Procurement MRP no Confirm", - "version": "1.0", + "version": "8.0.1.0.0", "depends": ["mrp"], "author": "OdooMRP team," "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "Tecnativa," + "Odoo Community Association (OCA)", "category": "MRP", - 'data': ["data/mrp_production_workflow.xml"], - 'demo': [], - 'installable': True, - 'auto_install': False, - 'uninstall_hook': 'uninstall_hook', + "data": ["data/mrp_production_workflow.xml"], + "installable": True, + "auto_install": False, + "uninstall_hook": "uninstall_hook", } diff --git a/procurement_mrp_no_confirm/i18n/procurement_mrp_no_confirm.pot b/procurement_mrp_no_confirm/i18n/procurement_mrp_no_confirm.pot deleted file mode 100644 index cc63a907b..000000000 --- a/procurement_mrp_no_confirm/i18n/procurement_mrp_no_confirm.pot +++ /dev/null @@ -1,32 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * procurement_mrp_no_confirm -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-11-20 16:56+0000\n" -"PO-Revision-Date: 2014-11-20 17:57+0100\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" - -#. module: procurement_mrp_no_confirm -#: model:ir.model,name:procurement_mrp_no_confirm.model_mrp_production -msgid "Manufacturing Order" -msgstr "" - -#. module: procurement_mrp_no_confirm -#: field:mrp.production,no_confirm:0 -msgid "No Confirm" -msgstr "" - -#. module: procurement_mrp_no_confirm -#: model:ir.model,name:procurement_mrp_no_confirm.model_procurement_order -msgid "Procurement" -msgstr "" - diff --git a/procurement_mrp_no_confirm/models/__init__.py b/procurement_mrp_no_confirm/models/__init__.py index f54843b35..ad16e3060 100644 --- a/procurement_mrp_no_confirm/models/__init__.py +++ b/procurement_mrp_no_confirm/models/__init__.py @@ -1,20 +1,7 @@ -# -*- encoding: 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import procurement_order from . import mrp_production diff --git a/procurement_mrp_no_confirm/models/mrp_production.py b/procurement_mrp_no_confirm/models/mrp_production.py index 8c3cd7e44..282213262 100644 --- a/procurement_mrp_no_confirm/models/mrp_production.py +++ b/procurement_mrp_no_confirm/models/mrp_production.py @@ -1,20 +1,7 @@ -# -*- encoding: 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields diff --git a/procurement_mrp_no_confirm/models/procurement_order.py b/procurement_mrp_no_confirm/models/procurement_order.py index ca3996903..9057b0b9f 100644 --- a/procurement_mrp_no_confirm/models/procurement_order.py +++ b/procurement_mrp_no_confirm/models/procurement_order.py @@ -1,20 +1,7 @@ -# -*- encoding: 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api diff --git a/procurement_mrp_no_confirm/static/description/icon.png b/procurement_mrp_no_confirm/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/procurement_mrp_no_confirm/static/description/icon.png differ diff --git a/procurement_mrp_no_confirm/tests/__init__.py b/procurement_mrp_no_confirm/tests/__init__.py new file mode 100644 index 000000000..5485d6ef2 --- /dev/null +++ b/procurement_mrp_no_confirm/tests/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_procurement diff --git a/procurement_mrp_no_confirm/tests/test_procurement.py b/procurement_mrp_no_confirm/tests/test_procurement.py new file mode 100644 index 000000000..9a0943876 --- /dev/null +++ b/procurement_mrp_no_confirm/tests/test_procurement.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# © 2015 AvanzOSC +# © 2015 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase +from datetime import datetime + + +class TestProcurement(TransactionCase): + + def setUp(self, *args, **kwargs): + result = super(TestProcurement, self).setUp(*args, **kwargs) + + self.product = self.env.ref("product.product_product_4b") + self.location = self.env.ref("stock.stock_location_stock") + + criteria = [ + ("location_id", "=", self.location.id), + ("action", "=", "manufacture"), + ] + + self.rule = self.env["procurement.rule"].search( + criteria)[0] + + self.proc_data = { + "name": "Test Procurement", + "product_id": self.product.id, + "location_id": self.location.id, + "product_qty": 1.0, + "product_uom": self.product.uom_id.id, + "date_planned": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + "rule_id": self.rule.id, + } + + return result + + def test_1(self): + proc = self.env["procurement.order"].create(self.proc_data) + + proc.run() + self.assertEqual( + proc.state, + "running") + + # procurement should generate MO + self.assertTrue(proc.production_id) + + # MO should in draft state + self.assertEqual( + proc.production_id.state, + "draft")