diff --git a/agreement_mrp/README.rst b/agreement_mrp/README.rst new file mode 100644 index 000000000..6f393dc7f --- /dev/null +++ b/agreement_mrp/README.rst @@ -0,0 +1,113 @@ +=============== +Agreement - 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-OCA%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/12.0/agreement_mrp + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_mrp + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Odoo Agreement App does not provide an easy way to access manufacturing orders +related to an agreement. Some organizations needs to have a quick access to the +production orders to track the performance of an agreement. + +This module allows you to link a manufacturing order to an agreement and +adds a smart button on the agreement to look at the list of related MOs. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +* Go to Manufacturing > Manufacturing Orders +* Select or create a manufacturing order and set the agreement +* Go to Agreement > Agreements +* Open the previous agreement and click on the smart button "Manufacturing Orders" to see the list of related MO + +Known issues / Roadmap +====================== + +The roadmap of the Agreement application is documented on +`Github `_. + +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 +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-smangukiya| image:: https://github.com/smangukiya.png?size=40px + :target: https://github.com/smangukiya + :alt: smangukiya +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainers `__: + +|maintainer-smangukiya| |maintainer-max3903| + +This module is part of the `OCA/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_mrp/__init__.py b/agreement_mrp/__init__.py new file mode 100644 index 000000000..1ae95437a --- /dev/null +++ b/agreement_mrp/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/agreement_mrp/__manifest__.py b/agreement_mrp/__manifest__.py new file mode 100644 index 000000000..16b0c6b16 --- /dev/null +++ b/agreement_mrp/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Agreement - MRP", + "summary": "Link manufacturing orders to an agreement", + "version": "14.0.1.0.0", + "category": "Contract", + "author": "Open Source Integrators, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/contract", + "depends": [ + "agreement_serviceprofile", + "mrp", + ], + "data": [ + "views/agreement_view.xml", + "views/mrp_view.xml", + ], + "installable": True, + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": [ + "smangukiya", + "max3903", + ], +} diff --git a/agreement_mrp/i18n/agreement_mrp.pot b/agreement_mrp/i18n/agreement_mrp.pot new file mode 100644 index 000000000..d615901fb --- /dev/null +++ b/agreement_mrp/i18n/agreement_mrp.pot @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "" + diff --git a/agreement_mrp/i18n/de.po b/agreement_mrp/i18n/de.po new file mode 100644 index 000000000..31770324a --- /dev/null +++ b/agreement_mrp/i18n/de.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-06-28 13:42+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.6.1\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "# Fertigungsaufträge" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "Fertigungsaufträge" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "Vereinbarung" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "Fertigungsaufträge anlegen" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "Fertigungsaufträge" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "Fertigungsauftrag" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "Dienstleistungsprofil" + +#~ msgid "agreement" +#~ msgstr "Vereinbarung" diff --git a/agreement_mrp/i18n/es.po b/agreement_mrp/i18n/es.po new file mode 100644 index 000000000..863832d0f --- /dev/null +++ b/agreement_mrp/i18n/es.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "" diff --git a/agreement_mrp/i18n/fr.po b/agreement_mrp/i18n/fr.po new file mode 100644 index 000000000..bc8b248ef --- /dev/null +++ b/agreement_mrp/i18n/fr.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-01-04 11:44+0000\n" +"Last-Translator: Rémi \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "# OFs" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "OFs" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "Accord" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "Creer les OFs" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "Ordres de Fabrication" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "Ordre de Production" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "Profil de service" diff --git a/agreement_mrp/i18n/it.po b/agreement_mrp/i18n/it.po new file mode 100644 index 000000000..be1a6dac4 --- /dev/null +++ b/agreement_mrp/i18n/it.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "" diff --git a/agreement_mrp/i18n/pt.po b/agreement_mrp/i18n/pt.po new file mode 100644 index 000000000..dc9c28b4e --- /dev/null +++ b/agreement_mrp/i18n/pt.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-17 19:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "# OP" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "OP" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "Acordo" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "Criar OPs" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "Ordens de Produção" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "Ordem de Produção" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "Perfil do Serviço" diff --git a/agreement_mrp/i18n/pt_BR.po b/agreement_mrp/i18n/pt_BR.po new file mode 100644 index 000000000..16f2e4368 --- /dev/null +++ b/agreement_mrp/i18n/pt_BR.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-12 05:03+0000\n" +"Last-Translator: Marcel Savegnago \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "# OPs" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "OPs" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "Acordo" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "Criar OPs" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "Ordens de Fabricação" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "Ordem de Produção" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "Perfil de Serviço" diff --git a/agreement_mrp/i18n/zh_CN.po b/agreement_mrp/i18n/zh_CN.po new file mode 100644 index 000000000..ede40ebe9 --- /dev/null +++ b/agreement_mrp/i18n/zh_CN.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-04 18:23+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_agreement__mo_count +msgid "# MOs" +msgstr "# 制造订单" + +#. module: agreement_mrp +#: model_terms:ir.ui.view,arch_db:agreement_mrp.partner_agreement_form_view +msgid "MOs" +msgstr "制造订单" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_agreement +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__agreement_id +msgid "Agreement" +msgstr "协议" + +#. module: agreement_mrp +#: model_terms:ir.actions.act_window,help:agreement_mrp.action_mrp_production_agreement_specific +msgid "Create MOs" +msgstr "创建制造订单" + +#. module: agreement_mrp +#: model:ir.actions.act_window,name:agreement_mrp.action_mrp_production_agreement_specific +msgid "Manufacture Orders" +msgstr "制造订单" + +#. module: agreement_mrp +#: model:ir.model,name:agreement_mrp.model_mrp_production +msgid "Production Order" +msgstr "生产单" + +#. module: agreement_mrp +#: model:ir.model.fields,field_description:agreement_mrp.field_mrp_production__serviceprofile_id +#: model_terms:ir.ui.view,arch_db:agreement_mrp.view_mrp_production_filter_agreement +msgid "Service Profile" +msgstr "服务资料" diff --git a/agreement_mrp/models/__init__.py b/agreement_mrp/models/__init__.py new file mode 100644 index 000000000..0d2be8bb1 --- /dev/null +++ b/agreement_mrp/models/__init__.py @@ -0,0 +1,7 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + mrp, + agreement, +) diff --git a/agreement_mrp/models/agreement.py b/agreement_mrp/models/agreement.py new file mode 100644 index 000000000..d7e737acf --- /dev/null +++ b/agreement_mrp/models/agreement.py @@ -0,0 +1,16 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class Agreement(models.Model): + _inherit = "agreement" + + mo_count = fields.Integer("# MOs", compute="_compute_mo_count") + + def _compute_mo_count(self): + for ag_rec in self: + ag_rec.mo_count = self.env["mrp.production"].search_count( + [("agreement_id", "in", ag_rec.ids)] + ) diff --git a/agreement_mrp/models/mrp.py b/agreement_mrp/models/mrp.py new file mode 100644 index 000000000..c00f3ae00 --- /dev/null +++ b/agreement_mrp/models/mrp.py @@ -0,0 +1,11 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MRPProduction(models.Model): + _inherit = "mrp.production" + + agreement_id = fields.Many2one("agreement", "Agreement") + serviceprofile_id = fields.Many2one("agreement.serviceprofile", "Service Profile") diff --git a/agreement_mrp/readme/CONTRIBUTORS.rst b/agreement_mrp/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..373b2a6a2 --- /dev/null +++ b/agreement_mrp/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. diff --git a/agreement_mrp/readme/CREDITS.rst b/agreement_mrp/readme/CREDITS.rst new file mode 100644 index 000000000..0eff0acf4 --- /dev/null +++ b/agreement_mrp/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Open Source Integrators diff --git a/agreement_mrp/readme/DESCRIPTION.rst b/agreement_mrp/readme/DESCRIPTION.rst new file mode 100644 index 000000000..5debb039b --- /dev/null +++ b/agreement_mrp/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +Odoo Agreement App does not provide an easy way to access manufacturing orders +related to an agreement. Some organizations needs to have a quick access to the +production orders to track the performance of an agreement. + +This module allows you to link a manufacturing order to an agreement and +adds a smart button on the agreement to look at the list of related MOs. diff --git a/agreement_mrp/readme/ROADMAP.rst b/agreement_mrp/readme/ROADMAP.rst new file mode 100644 index 000000000..7e6402cf9 --- /dev/null +++ b/agreement_mrp/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +The roadmap of the Agreement application is documented on +`Github `_. diff --git a/agreement_mrp/readme/USAGE.rst b/agreement_mrp/readme/USAGE.rst new file mode 100644 index 000000000..86eca654f --- /dev/null +++ b/agreement_mrp/readme/USAGE.rst @@ -0,0 +1,6 @@ +To use this module, you need to: + +* Go to Manufacturing > Manufacturing Orders +* Select or create a manufacturing order and set the agreement +* Go to Agreement > Agreements +* Open the previous agreement and click on the smart button "Manufacturing Orders" to see the list of related MO diff --git a/agreement_mrp/static/description/icon.png b/agreement_mrp/static/description/icon.png new file mode 100644 index 000000000..a99cce6be Binary files /dev/null and b/agreement_mrp/static/description/icon.png differ diff --git a/agreement_mrp/static/description/index.html b/agreement_mrp/static/description/index.html new file mode 100644 index 000000000..d7b0e60ec --- /dev/null +++ b/agreement_mrp/static/description/index.html @@ -0,0 +1,451 @@ + + + + + + +Agreement - MRP + + + +
+

Agreement - MRP

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

Odoo Agreement App does not provide an easy way to access manufacturing orders +related to an agreement. Some organizations needs to have a quick access to the +production orders to track the performance of an agreement.

+

This module allows you to link a manufacturing order to an agreement and +adds a smart button on the agreement to look at the list of related MOs.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Go to Manufacturing > Manufacturing Orders
  • +
  • Select or create a manufacturing order and set the agreement
  • +
  • Go to Agreement > Agreements
  • +
  • Open the previous agreement and click on the smart button “Manufacturing Orders” to see the list of related MO
  • +
+
+
+

Known issues / Roadmap

+

The roadmap of the Agreement application is documented on +Github.

+
+
+

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

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainers:

+

smangukiya max3903

+

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

+

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

+
+
+
+ + diff --git a/agreement_mrp/tests/__init__.py b/agreement_mrp/tests/__init__.py new file mode 100644 index 000000000..8e8907749 --- /dev/null +++ b/agreement_mrp/tests/__init__.py @@ -0,0 +1,3 @@ +# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). + +from . import test_agreement_mrp diff --git a/agreement_mrp/tests/test_agreement_mrp.py b/agreement_mrp/tests/test_agreement_mrp.py new file mode 100644 index 000000000..26625d3e7 --- /dev/null +++ b/agreement_mrp/tests/test_agreement_mrp.py @@ -0,0 +1,44 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import odoo.tests.common as common +from odoo import fields + + +class TestAgreementMrp(common.TransactionCase): + def setUp(self): + super(TestAgreementMrp, self).setUp() + + self.agreement_obj = self.env["agreement"] + self.mrp_production_obj = self.env["mrp.production"] + self.agreement_type_id = self.env["agreement.type"].create( + {"name": "Test Agreement Type", "active": True} + ) + self.product = self.env.ref( + "mrp.product_product_computer_desk_bolt_product_template" + ) + + def test_fieldservice_purchase(self): + agreement_vals = { + "name": "Test Agreement", + "agreement_type_id": self.agreement_type_id.id, + "description": "Test Agreement", + "start_date": fields.Date.today(), + "end_date": fields.Date.today(), + } + agreement = self.agreement_obj.create(agreement_vals) + + mrp_production_vals = { + "product_id": self.product.product_variant_id.id, + "agreement_id": agreement.id, + "product_uom_id": self.product.uom_id.id, + } + mrp_production_new = self.mrp_production_obj.new(mrp_production_vals) + mrp_production_vals.update( + mrp_production_new.default_get(mrp_production_new._fields) + ) + + self.mrp_production_obj.create(mrp_production_vals) + + agreement._compute_mo_count() + self.assertEqual(agreement.mo_count, 1, "Wrong no of MO's!") diff --git a/agreement_mrp/views/agreement_view.xml b/agreement_mrp/views/agreement_view.xml new file mode 100644 index 000000000..753ac0bf6 --- /dev/null +++ b/agreement_mrp/views/agreement_view.xml @@ -0,0 +1,39 @@ + + + + Manufacture Orders + ir.actions.act_window + mrp.production + tree,form + [('agreement_id', '=', active_id)] + +

+ Create MOs +

+
+
+ + + agreement.form.mrp + agreement + + + + + + + + +
diff --git a/agreement_mrp/views/mrp_view.xml b/agreement_mrp/views/mrp_view.xml new file mode 100644 index 000000000..e30a39069 --- /dev/null +++ b/agreement_mrp/views/mrp_view.xml @@ -0,0 +1,35 @@ + + + + mrp.production.form.agreement + mrp.production + + + + + + + + + + + + mrp.production.select.agreement + mrp.production + + + + + + + + + diff --git a/setup/agreement_mrp/odoo/addons/agreement_mrp b/setup/agreement_mrp/odoo/addons/agreement_mrp new file mode 120000 index 000000000..38006d037 --- /dev/null +++ b/setup/agreement_mrp/odoo/addons/agreement_mrp @@ -0,0 +1 @@ +../../../../agreement_mrp \ No newline at end of file diff --git a/setup/agreement_mrp/setup.py b/setup/agreement_mrp/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/agreement_mrp/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)