diff --git a/quality_control_mrp_oca/README.rst b/quality_control_mrp_oca/README.rst index 85c94fbf7..fc0ed1fa0 100644 --- a/quality_control_mrp_oca/README.rst +++ b/quality_control_mrp_oca/README.rst @@ -17,13 +17,13 @@ MRP extension for quality control (OCA) :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github - :target: https://github.com/OCA/manufacture/tree/14.0/quality_control_mrp_oca + :target: https://github.com/OCA/manufacture/tree/16.0/quality_control_mrp_oca :alt: OCA/manufacture .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-quality_control_mrp_oca + :target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-quality_control_mrp_oca :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -44,7 +44,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -82,6 +82,6 @@ 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. -This module is part of the `OCA/manufacture `_ project on GitHub. +This module is part of the `OCA/manufacture `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/quality_control_mrp_oca/__manifest__.py b/quality_control_mrp_oca/__manifest__.py index d321669c9..dcc7397ce 100644 --- a/quality_control_mrp_oca/__manifest__.py +++ b/quality_control_mrp_oca/__manifest__.py @@ -4,7 +4,7 @@ { "name": "MRP extension for quality control (OCA)", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Quality control", "license": "AGPL-3", "author": "OdooMRP team, " diff --git a/quality_control_mrp_oca/models/qc_inspection.py b/quality_control_mrp_oca/models/qc_inspection.py index 2f9da5652..0d688db45 100644 --- a/quality_control_mrp_oca/models/qc_inspection.py +++ b/quality_control_mrp_oca/models/qc_inspection.py @@ -27,10 +27,11 @@ class QcInspection(models.Model): @api.depends("object_id") def _compute_product_id(self): """Overriden for getting the product from a manufacturing order.""" + res = super()._compute_product_id() for inspection in self: - super()._compute_product_id() if inspection.object_id and inspection.object_id._name == "mrp.production": inspection.product_id = inspection.object_id.product_id + return res def object_selection_values(self): objects = super().object_selection_values() diff --git a/quality_control_mrp_oca/static/description/index.html b/quality_control_mrp_oca/static/description/index.html index b61876a93..abaa55c0e 100644 --- a/quality_control_mrp_oca/static/description/index.html +++ b/quality_control_mrp_oca/static/description/index.html @@ -1,4 +1,3 @@ - @@ -369,7 +368,7 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:b443f8480964e8dfd7d279284bb7bf75e74b7a10f63c943321af023ef0efd8d4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/manufacture Translate me on Weblate Try me on Runboat

This module defines a trigger that creates quality control inspections when a production order is finished.

It also adds the shortcuts related to these inspections on production orders.

@@ -390,7 +389,7 @@ production order is finished.

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -423,7 +422,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

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.

-

This module is part of the OCA/manufacture project on GitHub.

+

This module is part of the OCA/manufacture project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/quality_control_mrp_oca/tests/test_quality_control_mrp.py b/quality_control_mrp_oca/tests/test_quality_control_mrp.py index 05c7e8972..e52784283 100644 --- a/quality_control_mrp_oca/tests/test_quality_control_mrp.py +++ b/quality_control_mrp_oca/tests/test_quality_control_mrp.py @@ -2,57 +2,48 @@ # Copyright 2018 Simone Rubino - Agile Business Group # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo.tests.common import Form, TransactionCase +from odoo.tests.common import Form + +from odoo.addons.quality_control_oca.tests.test_quality_control import ( + TestQualityControlOcaBase, +) -class TestQualityControlMrp(TransactionCase): - def setUp(self): - super().setUp() - self.inspection_model = self.env["qc.inspection"] - self.qc_trigger_model = self.env["qc.trigger"] - self.test = self.env.ref("quality_control_oca.qc_test_1") - self.trigger = self.env.ref("quality_control_mrp_oca.qc_trigger_mrp") - # Category - category_form = Form(self.env["product.category"]) - category_form.name = "Test category" - self.category = category_form.save() - # Product - product_form = Form(self.env["product.template"]) - product_form.name = "Test Product" - product_form.type = "product" - self.product = product_form.save() +class TestQualityControlMrp(TestQualityControlOcaBase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.trigger = cls.env.ref("quality_control_mrp_oca.qc_trigger_mrp") # Materials - product_form = Form(self.env["product.product"]) + product_form = Form(cls.env["product.product"]) product_form.name = "Part 1 Product" - product_form.type = "product" - self.mat1 = product_form.save() - product_form = Form(self.env["product.product"]) + cls.mat1 = product_form.save() + product_form = Form(cls.env["product.product"]) product_form.name = "Part 2 Product" - product_form.type = "product" - self.mat2 = product_form.save() + cls.mat2 = product_form.save() # Bom - bom_form = Form(self.env["mrp.bom"]) - bom_form.product_tmpl_id = self.product + bom_form = Form(cls.env["mrp.bom"]) + bom_form.product_tmpl_id = cls.product.product_tmpl_id bom_form.product_qty = 1.0 bom_form.type = "normal" with bom_form.bom_line_ids.new() as material_form: - material_form.product_id = self.mat1 + material_form.product_id = cls.mat1 material_form.product_qty = 1 with bom_form.bom_line_ids.new() as material_form: - material_form.product_id = self.mat2 + material_form.product_id = cls.mat2 material_form.product_qty = 1 - self.bom = bom_form.save() + cls.bom = bom_form.save() # Production - production_form = Form(self.env["mrp.production"]) - production_form.product_id = self.product.product_variant_id - production_form.bom_id = self.bom + production_form = Form(cls.env["mrp.production"]) + production_form.product_id = cls.product.product_variant_id + production_form.bom_id = cls.bom production_form.product_qty = 2.0 - self.production1 = production_form.save() - self.production1.action_confirm() - self.production1.action_assign() + cls.production1 = production_form.save() + cls.production1.action_confirm() + cls.production1.action_assign() # Inspection - inspection_lines = self.inspection_model._prepare_inspection_lines(self.test) - self.inspection1 = self.inspection_model.create( + inspection_lines = cls.inspection_model._prepare_inspection_lines(cls.test) + cls.inspection1 = cls.inspection_model.create( {"name": "Test Inspection", "inspection_lines": inspection_lines} ) diff --git a/quality_control_mrp_oca/views/mrp_production_view.xml b/quality_control_mrp_oca/views/mrp_production_view.xml index dc5ad3960..dec9110ce 100644 --- a/quality_control_mrp_oca/views/mrp_production_view.xml +++ b/quality_control_mrp_oca/views/mrp_production_view.xml @@ -15,10 +15,6 @@ mrp.production.form.qc mrp.production -