From 565796ff2657f53833866fab2895836f6d40a729 Mon Sep 17 00:00:00 2001 From: Unai Beristain Date: Wed, 26 Jun 2024 09:25:07 +0200 Subject: [PATCH] [ADD] Add module mrp_production_quality_operator --- custom_mrp_production_fields/__manifest__.py | 16 -------- .../views/mrp_production_views.xml | 27 -------------- mrp_production_quality_operator/README.rst | 37 +++++++++++++++++++ mrp_production_quality_operator/__init__.py | 1 + .../__manifest__.py | 18 +++++++++ .../models/__init__.py | 1 + .../models/mrp_production.py | 11 ++++++ .../views/mrp_production_views.xml | 28 ++++++++++++++ 8 files changed, 96 insertions(+), 43 deletions(-) delete mode 100644 custom_mrp_production_fields/__manifest__.py delete mode 100644 custom_mrp_production_fields/views/mrp_production_views.xml create mode 100644 mrp_production_quality_operator/README.rst create mode 100644 mrp_production_quality_operator/__init__.py create mode 100644 mrp_production_quality_operator/__manifest__.py create mode 100644 mrp_production_quality_operator/models/__init__.py create mode 100644 mrp_production_quality_operator/models/mrp_production.py create mode 100644 mrp_production_quality_operator/views/mrp_production_views.xml diff --git a/custom_mrp_production_fields/__manifest__.py b/custom_mrp_production_fields/__manifest__.py deleted file mode 100644 index 480ccd97f..000000000 --- a/custom_mrp_production_fields/__manifest__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': 'Custom MRP Production Fields', - 'version': '1.0', - 'category': 'Manufacturing', - 'summary': 'Adds custom fields to MRP Production', - 'author': 'AvanzOSC', - 'website': 'http://www.avanzosc.es', - 'license': 'AGPL-3', - 'depends': ['mrp_production_usability', 'sale_mrp'], - 'data': [ - 'views/mrp_production_views.xml', - ], - 'installable': True, - 'auto_install': False, -} diff --git a/custom_mrp_production_fields/views/mrp_production_views.xml b/custom_mrp_production_fields/views/mrp_production_views.xml deleted file mode 100644 index 1a147d435..000000000 --- a/custom_mrp_production_fields/views/mrp_production_views.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - mrp.production.form.inherit - mrp.production - - - - - - - - - - mrp.production.tree.inherit - mrp.production - - - - - - - - - - diff --git a/mrp_production_quality_operator/README.rst b/mrp_production_quality_operator/README.rst new file mode 100644 index 000000000..85c89dfed --- /dev/null +++ b/mrp_production_quality_operator/README.rst @@ -0,0 +1,37 @@ +.. 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 Production Quality Operator Custom Fields +============================================= + +The **MRP Production Quality Operator Custom Fields** module enhances +the functionality of MRP Production in Odoo by adding custom fields +`qty_rejected`, `operator_id`, and `quality_responsible_id`. +These fields allow for better tracking and management of +production quality and operator responsibilities. + +Features +======== + +- **Custom Fields**: + - **Quantity Rejected**: Tracks the quantity of rejected products during production. + - **Operator**: Associates an operator with the production order. + - **Quality Responsible**: Identifies the responsible person for ensuring product quality. + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ +- Unai Beristain + +Do not contact contributors directly about support or help with technical issues. diff --git a/mrp_production_quality_operator/__init__.py b/mrp_production_quality_operator/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/mrp_production_quality_operator/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mrp_production_quality_operator/__manifest__.py b/mrp_production_quality_operator/__manifest__.py new file mode 100644 index 000000000..59514ab57 --- /dev/null +++ b/mrp_production_quality_operator/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Unai Beristain - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "MRP Production Quality Operator Custom Fields", + "version": "14.0.1.0.0", + "category": "Manufacturing", + "summary": "Fields qty_rejected, operator_id and quality_responsible_id to production", + "author": "AvanzOSC", + "website": "https://github.com/avanzosc/mrp-addons", + "license": "AGPL-3", + "depends": ["mrp", "hr"], + "data": [ + "views/mrp_production_views.xml", + ], + "installable": True, + "auto_install": False, +} diff --git a/mrp_production_quality_operator/models/__init__.py b/mrp_production_quality_operator/models/__init__.py new file mode 100644 index 000000000..a9e5f13e4 --- /dev/null +++ b/mrp_production_quality_operator/models/__init__.py @@ -0,0 +1 @@ +from . import mrp_production diff --git a/mrp_production_quality_operator/models/mrp_production.py b/mrp_production_quality_operator/models/mrp_production.py new file mode 100644 index 000000000..e403d60fa --- /dev/null +++ b/mrp_production_quality_operator/models/mrp_production.py @@ -0,0 +1,11 @@ +from odoo import fields, models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + qty_rejected = fields.Float(string="Rejected Quantity") + operator_id = fields.Many2one(comodel_name="hr.employee", string="Operator") + quality_responsible_id = fields.Many2one( + comodel_name="hr.employee", string="Quality Responsible" + ) diff --git a/mrp_production_quality_operator/views/mrp_production_views.xml b/mrp_production_quality_operator/views/mrp_production_views.xml new file mode 100644 index 000000000..7d877d5bc --- /dev/null +++ b/mrp_production_quality_operator/views/mrp_production_views.xml @@ -0,0 +1,28 @@ + + + + mrp.production + + + + + + + + + + + + + + mrp.production + + + + + + + + + +