diff --git a/oxigen_mrp/README.rst b/oxigen_mrp/README.rst new file mode 100644 index 00000000..2ccddff5 --- /dev/null +++ b/oxigen_mrp/README.rst @@ -0,0 +1,59 @@ +========== +Oxigen MRP +========== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-oxigensalud%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/oxigensalud/odoo-addons/tree/14.0/oxigen_mrp + :alt: oxigensalud/odoo-addons + +|badge1| |badge2| |badge3| + +* Added lot dates, product types and the logic to keep the integrity + +**Table of contents** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* NuoBiT Solutions SL + +Contributors +~~~~~~~~~~~~ + +* `NuoBiT `_: + + * Eric Antones + +Maintainers +~~~~~~~~~~~ + +This module is part of the `oxigensalud/odoo-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/oxigen_mrp/__init__.py b/oxigen_mrp/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/oxigen_mrp/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/oxigen_mrp/__manifest__.py b/oxigen_mrp/__manifest__.py new file mode 100644 index 00000000..1849cc94 --- /dev/null +++ b/oxigen_mrp/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright NuoBiT Solutions - Eric Antones +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Oxigen MRP", + "summary": "Customizations for Oxigen in MRP application", + "version": "14.0.1.0.0", + "author": "NuoBiT Solutions SL", + "website": "https://github.com/oxigensalud/odoo-addons", + "category": "Manufacturing/Manufacturing", + "depends": ["mrp"], + "installable": True, + "license": "AGPL-3", + "data": [ + "views/product_template.xml", + "views/stock_production_lot_views.xml", + ], +} diff --git a/oxigen_mrp/i18n/es.po b/oxigen_mrp/i18n/es.po new file mode 100644 index 00000000..b21a85f3 --- /dev/null +++ b/oxigen_mrp/i18n/es.po @@ -0,0 +1,100 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * oxigen_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-30 20:57+0000\n" +"PO-Revision-Date: 2023-08-30 20:57+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: oxigen_mrp +#: model:ir.model.fields.selection,name:oxigen_mrp.selection__product_template__mrp_type__cylinder +msgid "Cylinder" +msgstr "Cilindro" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_product_template__display_name +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: oxigen_mrp +#: model:ir.model.fields.selection,name:oxigen_mrp.selection__product_template__mrp_type__empty_cylinder +msgid "Empty Cylinder" +msgstr "Cilindro vacío" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_product_template__id +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__id +msgid "ID" +msgstr "" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_product_template____last_update +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: oxigen_mrp +#: model:ir.model,name:oxigen_mrp.model_stock_production_lot +msgid "Lot/Serial" +msgstr "Lote/Número de serie" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_product_product__mrp_type +#: model:ir.model.fields,field_description:oxigen_mrp.field_product_template__mrp_type +msgid "Type (MRP)" +msgstr "Tipo (MRP)" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__manufacture_date +msgid "Manufacture Date" +msgstr "Fecha fabricación" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__manufacturer +msgid "Manufacturer" +msgstr "Fabricante" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__mrp_fields_allowed +msgid "Mrp Fields Allowed" +msgstr "" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__next_retesting_date +msgid "Next Retesting Date" +msgstr "Fecha próximo retimbrado" + +#. module: oxigen_mrp +#: model:ir.model,name:oxigen_mrp.model_product_template +msgid "Product Template" +msgstr "Plantilla de producto" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__retesting_date +msgid "Retesting Date" +msgstr "Fecha retimbrado" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__valid_until_date +msgid "Valid Until Date" +msgstr "Fecha límite de uso" + +#. module: oxigen_mrp +#: model:ir.model.fields.selection,name:oxigen_mrp.selection__product_template__mrp_type__valve +msgid "Valve" +msgstr "Válvula" + +#. module: oxigen_mrp +#: model:ir.model.fields,field_description:oxigen_mrp.field_stock_production_lot__weight +msgid "Weight" +msgstr "Peso" diff --git a/oxigen_mrp/models/__init__.py b/oxigen_mrp/models/__init__.py new file mode 100644 index 00000000..ae2d3112 --- /dev/null +++ b/oxigen_mrp/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_template +from . import stock_production_lot diff --git a/oxigen_mrp/models/product_template.py b/oxigen_mrp/models/product_template.py new file mode 100644 index 00000000..d945eb07 --- /dev/null +++ b/oxigen_mrp/models/product_template.py @@ -0,0 +1,15 @@ +# Part of Odoo. See LICENSE file for full copyright and licensing details. +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + mrp_type = fields.Selection( + string="Type (MRP)", + selection=[ + ("cylinder", "Cylinder"), + ("valve", "Valve"), + ("empty_cylinder", "Empty Cylinder"), + ], + ) diff --git a/oxigen_mrp/models/stock_production_lot.py b/oxigen_mrp/models/stock_production_lot.py new file mode 100644 index 00000000..486279a5 --- /dev/null +++ b/oxigen_mrp/models/stock_production_lot.py @@ -0,0 +1,51 @@ +# Copyright NuoBiT Solutions - Eric Antones +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +import json + +from odoo import api, fields, models + +from odoo.addons.base_sparse_field.models.fields import Serialized + + +class ProductionLot(models.Model): + _inherit = "stock.production.lot" + + def _get_product_mrp_workflow(self): + return { + "cylinder": { + "manufacturer", + "weight", + "manufacture_date", + "retesting_date", + "next_retesting_date", + }, + "valve": {"manufacturer", "manufacture_date", "valid_until_date"}, + "empty_cylinder": { + "manufacturer", + "manufacture_date", + "retesting_date", + "next_retesting_date", + }, + } + + manufacturer = fields.Many2one( + comodel_name="res.partner", + ) + weight = fields.Float() + manufacture_date = fields.Date() + retesting_date = fields.Date() + next_retesting_date = fields.Date() + valid_until_date = fields.Date() + + mrp_fields_allowed = Serialized(compute="_compute_mrp_fields_allowed") + + @api.depends("product_id") + def _compute_mrp_fields_allowed(self): + allowed_fields = self._get_product_mrp_workflow() + for rec in self: + rec.mrp_fields_allowed = json.dumps( + list(allowed_fields.get(rec.product_id.mrp_type, set())) + ) + + # TODO: write and create methods to check the fields allowed and/or + # constraints to check the fields allowed diff --git a/oxigen_mrp/readme/CONTRIBUTORS.rst b/oxigen_mrp/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..77acb88d --- /dev/null +++ b/oxigen_mrp/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `NuoBiT `_: + + * Eric Antones diff --git a/oxigen_mrp/readme/DESCRIPTION.rst b/oxigen_mrp/readme/DESCRIPTION.rst new file mode 100644 index 00000000..e0cd35d7 --- /dev/null +++ b/oxigen_mrp/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +* Added lot dates, product types and the logic to keep the integrity diff --git a/oxigen_mrp/static/description/icon.png b/oxigen_mrp/static/description/icon.png new file mode 100644 index 00000000..1cd641e7 Binary files /dev/null and b/oxigen_mrp/static/description/icon.png differ diff --git a/oxigen_mrp/static/description/index.html b/oxigen_mrp/static/description/index.html new file mode 100644 index 00000000..ef4f6f2b --- /dev/null +++ b/oxigen_mrp/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +Oxigen MRP + + + +
+

Oxigen MRP

+ + +

Beta License: AGPL-3 oxigensalud/odoo-addons

+
    +
  • Added lot dates, product types and the logic to keep the integrity
  • +
+

Table of contents

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions SL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the oxigensalud/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/oxigen_mrp/views/product_template.xml b/oxigen_mrp/views/product_template.xml new file mode 100644 index 00000000..61d40601 --- /dev/null +++ b/oxigen_mrp/views/product_template.xml @@ -0,0 +1,18 @@ + + + + + oxigen.mrp.product.template + product.template + + + + + + + + diff --git a/oxigen_mrp/views/stock_production_lot_views.xml b/oxigen_mrp/views/stock_production_lot_views.xml new file mode 100644 index 00000000..93db460f --- /dev/null +++ b/oxigen_mrp/views/stock_production_lot_views.xml @@ -0,0 +1,43 @@ + + + + + oxigen.mrp.production.lot.form + stock.production.lot + + + + + + + + + + + + + + + + + + diff --git a/setup/oxigen_mrp/odoo/addons/oxigen_mrp b/setup/oxigen_mrp/odoo/addons/oxigen_mrp new file mode 120000 index 00000000..feff50d2 --- /dev/null +++ b/setup/oxigen_mrp/odoo/addons/oxigen_mrp @@ -0,0 +1 @@ +../../../../oxigen_mrp \ No newline at end of file diff --git a/setup/oxigen_mrp/setup.py b/setup/oxigen_mrp/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/oxigen_mrp/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)