From d6334f4657d3abd7817369d02e637838f263e87a 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/__init__.py | 1 + .../__manifest__.py | 18 ++++++++++++ .../models/__init__.py | 1 + .../models/mrp_production.py | 11 ++++++++ .../views/mrp_production_views.xml | 28 +++++++++++++++++++ 7 files changed, 59 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/__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/__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..3a727e561 --- /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": "Adds custom fields qty_rejected, operator_id and quality_responsible_id to MRP 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 + + + + + + + + + +