[MIG] quality_control_mrp: migrated from odoomrp/odoomrp-wip

This commit is contained in:
oihane
2015-10-26 12:31:55 +01:00
parent 0a3069bb3a
commit 75d638db0a
6 changed files with 145 additions and 76 deletions

View File

@@ -1,3 +1,8 @@
.. 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
=================================
MRP extension for quality control
=================================
@@ -6,7 +11,42 @@ production order is finished.
It also adds the shortcuts related to these inspections on production orders.
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
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 `here <https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
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 http://odoo-community.org.

View File

@@ -1,40 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2014 AvanzOsc (http://www.avanzosc.es)
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
# (c) 2014 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Quality control - MRP",
"version": "1.0",
"author": "OdooMRP team,"
"AvanzOSC,"
"Serv. Tecnol. Avanzados - Pedro M. Baeza",
"version": "8.0.1.0.0",
"category": "Quality control",
"license": "AGPL-3",
"author": "OdooMRP team, "
"AvanzOSC, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Odoo Community Association (OCA)",
"website": "http://www.odoomrp.com",
"contributors": [
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com",
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
"Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
],
"category": "Quality control",
"depends": [
'quality_control',
'quality_control_stock',
'mrp',
"quality_control",
"quality_control_stock",
"mrp",
],
"data": [
'data/quality_control_mrp_data.xml',

View File

@@ -1,44 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * quality_control_mrp
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-12-10 17:45+0000\n"
"PO-Revision-Date: 2014-12-10 17:45+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: quality_control_mrp
#: help:mrp.production,qc_inspections:0
msgid "Inspections related to this production."
msgstr ""
#. module: quality_control_mrp
#: view:qc.inspection:quality_control_mrp.qc_inspection_search_view_production
#: field:qc.inspection,production:0
msgid "Production"
msgstr ""
#. module: quality_control_mrp
#: model:qc.trigger,name:quality_control_mrp.qc_trigger_mrp
msgid "Production done"
msgstr ""
#. module: quality_control_mrp
#: view:qc.inspection.line:quality_control_mrp.qc_inspection_line_search_production_view
#: field:qc.inspection.line,production:0
msgid "Production order"
msgstr ""
#. module: quality_control_mrp
#: view:mrp.production:quality_control_mrp.mrp_production_qc_view
msgid "inspections"
msgstr ""

View File

@@ -3,6 +3,8 @@
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
from openerp.addons.quality_control.models.qc_trigger_line import\
_filter_trigger_lines
class MrpProduction(models.Model):
@@ -42,6 +44,6 @@ class MrpProduction(models.Model):
trigger_lines = trigger_lines.union(
self.env[model].get_trigger_line_for_product(
qc_trigger, move.product_id))
for trigger_line in trigger_lines:
for trigger_line in _filter_trigger_lines(trigger_lines):
inspection_model._make_inspection(move, trigger_line)
return res

View File

@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# (c) 2015 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_quality_control_mrp

View File

@@ -0,0 +1,80 @@
# -*- coding: utf-8 -*-
# (c) 2015 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestQualityControlMrp(TransactionCase):
def setUp(self):
super(TestQualityControlMrp, self).setUp()
self.production_model = self.env['mrp.production']
self.qc_trigger_model = self.env['qc.trigger']
self.product = self.env.ref('product.product_product_4')
self.test = self.env.ref('quality_control.qc_test_1')
self.trigger = self.env.ref('quality_control_mrp.qc_trigger_mrp')
self.production1 = self.production_model.create({
'product_id': self.product.id,
'product_uom': self.product.uom_id.id,
})
self.production1.action_confirm()
self.production1.action_assign()
def test_inspection_create_for_product(self):
self.product.qc_triggers = [(
0, 0, {
'trigger': self.trigger.id,
'test': self.test.id,
}
)]
self.production1.action_produce(
self.production1.id, self.production1.product_qty,
'consume_produce')
self.assertEqual(self.production1.created_inspections, 1,
'Only one inspection must be created')
def test_inspection_create_for_template(self):
self.product.product_tmpl_id.qc_triggers = [(
0, 0, {
'trigger': self.trigger.id,
'test': self.test.id,
}
)]
self.production1.action_produce(
self.production1.id, self.production1.product_qty,
'consume_produce')
self.assertEqual(self.production1.created_inspections, 1,
'Only one inspection must be created')
def test_inspection_create_for_category(self):
self.product.categ_id.qc_triggers = [(
0, 0, {
'trigger': self.trigger.id,
'test': self.test.id,
}
)]
self.production1.action_produce(
self.production1.id, self.production1.product_qty,
'consume_produce')
self.assertEqual(self.production1.created_inspections, 1,
'Only one inspection must be created')
def test_inspection_create_only_one(self):
self.product.qc_triggers = [(
0, 0, {
'trigger': self.trigger.id,
'test': self.test.id,
}
)]
self.product.categ_id.qc_triggers = [(
0, 0, {
'trigger': self.trigger.id,
'test': self.test.id,
}
)]
self.production1.action_produce(
self.production1.id, self.production1.product_qty,
'consume_produce')
self.assertEqual(self.production1.created_inspections, 1,
'Only one inspection must be created')