diff --git a/agreement/models/res_config_settings.py b/agreement/models/res_config_settings.py index c84dca13..2fa96012 100644 --- a/agreement/models/res_config_settings.py +++ b/agreement/models/res_config_settings.py @@ -11,5 +11,7 @@ class ResConfigSettings(models.TransientModel): string='Manage maintenance agreements and contracts') module_agreement_mrp = fields.Boolean( string='Link your manufacturing orders to an agreement.') + module_agreement_repair = fields.Boolean( + string='Link your repair orders to an agreement.') module_agreement_stock = fields.Boolean( string='Link your pickings to an agreement.') diff --git a/agreement/views/res_config_settings.xml b/agreement/views/res_config_settings.xml index 67209cde..76c9b706 100644 --- a/agreement/views/res_config_settings.xml +++ b/agreement/views/res_config_settings.xml @@ -34,6 +34,17 @@

Advanced Features

+
+
+ +
+
+
+
@@ -45,19 +56,28 @@
- -
-
+
+
+ +
+
+
+
diff --git a/agreement_repair/README.rst b/agreement_repair/README.rst new file mode 100644 index 00000000..21cd7854 --- /dev/null +++ b/agreement_repair/README.rst @@ -0,0 +1,21 @@ +**This file is going to be generated by oca-gen-addon-readme.** + +*Manual changes will be overwritten.* + +Please provide content in the ``readme`` directory: + +* **DESCRIPTION.rst** (required) +* INSTALL.rst (optional) +* CONFIGURE.rst (optional) +* **USAGE.rst** (optional, highly recommended) +* DEVELOP.rst (optional) +* ROADMAP.rst (optional) +* HISTORY.rst (optional, recommended) +* **CONTRIBUTORS.rst** (optional, highly recommended) +* CREDITS.rst (optional) + +Content of this README will also be drawn from the addon manifest, +from keys such as name, authors, maintainers, development_status, +and license. + +A good, one sentence summary in the manifest is also highly recommended. diff --git a/agreement_repair/__init__.py b/agreement_repair/__init__.py new file mode 100644 index 00000000..631bd489 --- /dev/null +++ b/agreement_repair/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/agreement_repair/__manifest__.py b/agreement_repair/__manifest__.py new file mode 100644 index 00000000..50d310d4 --- /dev/null +++ b/agreement_repair/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Agreement - Repair', + 'summary': 'Link repair orders to an agreement', + 'version': '11.0.0.0.1', + 'category': 'Contract', + 'author': 'Open Source Integrators, ' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/contract', + 'depends': [ + 'agreement', + 'mrp_repair', + ], + 'data': [ + 'views/agreement_view.xml', + 'views/repair_view.xml', + ], + 'installable': True, + 'license': 'AGPL-3', + 'development_status': 'Beta', + 'maintainers': [ + 'smangukiya', + 'max3903', + ], +} diff --git a/agreement_repair/models/__init__.py b/agreement_repair/models/__init__.py new file mode 100644 index 00000000..57f41159 --- /dev/null +++ b/agreement_repair/models/__init__.py @@ -0,0 +1,7 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + repair, + agreement, +) diff --git a/agreement_repair/models/agreement.py b/agreement_repair/models/agreement.py new file mode 100644 index 00000000..f47a4492 --- /dev/null +++ b/agreement_repair/models/agreement.py @@ -0,0 +1,21 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class Agreement(models.Model): + _inherit = "agreement" + + repair_count = fields.Integer('# Repair Orders', + compute='_compute_repair_count') + + @api.multi + def _compute_repair_count(self): + data = self.env['mrp.repair'].read_group( + [('agreement_id', 'in', self.ids)], + ['agreement_id'], ['agreement_id']) + count_data = dict((item['agreement_id'][0], + item['agreement_id_count']) for item in data) + for agreement in self: + agreement.repair_count = count_data.get(agreement.id, 0) diff --git a/agreement_repair/models/repair.py b/agreement_repair/models/repair.py new file mode 100644 index 00000000..fa8fecea --- /dev/null +++ b/agreement_repair/models/repair.py @@ -0,0 +1,12 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MRPRepair(models.Model): + _inherit = "mrp.repair" + + agreement_id = fields.Many2one('agreement', 'Agreement') + serviceprofile_id = fields.Many2one('agreement.serviceprofile', + 'Service Profile') diff --git a/agreement_repair/readme/CONTRIBUTORS.rst b/agreement_repair/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..a76235f8 --- /dev/null +++ b/agreement_repair/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sandip Mangukiya diff --git a/agreement_repair/readme/CREDITS.rst b/agreement_repair/readme/CREDITS.rst new file mode 100644 index 00000000..0eff0acf --- /dev/null +++ b/agreement_repair/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Open Source Integrators diff --git a/agreement_repair/readme/DESCRIPTION.rst b/agreement_repair/readme/DESCRIPTION.rst new file mode 100644 index 00000000..c2cd5803 --- /dev/null +++ b/agreement_repair/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +Odoo Agreement App does not provide an easy way to access repair orders related to an agreement. +Some organizations needs to have a quick access to repair orders to track the performance of an agreement. + +This module allows you to link a repair order to an agreement and +adds a smart button on the agreement to look at the list of related repair orders. diff --git a/agreement_repair/readme/ROADMAP.rst b/agreement_repair/readme/ROADMAP.rst new file mode 100644 index 00000000..7e6402cf --- /dev/null +++ b/agreement_repair/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +The roadmap of the Agreement application is documented on +`Github `_. diff --git a/agreement_repair/readme/USAGE.rst b/agreement_repair/readme/USAGE.rst new file mode 100644 index 00000000..02bdbad4 --- /dev/null +++ b/agreement_repair/readme/USAGE.rst @@ -0,0 +1,7 @@ +To use this module, you need to: + +* Go to Repair > Repair Orders +* Select or create a repair order and set the agreement +* Go to Agreement > Agreements +* Open the previous agreement +* Click on the smart button "Repairs" to see the list of related repair orders diff --git a/agreement_repair/static/description/icon.png b/agreement_repair/static/description/icon.png new file mode 100644 index 00000000..23ce9313 Binary files /dev/null and b/agreement_repair/static/description/icon.png differ diff --git a/agreement_repair/static/description/index.html b/agreement_repair/static/description/index.html new file mode 100644 index 00000000..a798df62 --- /dev/null +++ b/agreement_repair/static/description/index.html @@ -0,0 +1,458 @@ + + + + + + +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

+ +
+

Installation

+

To install Field Service and have the mapping features, +you need to install agreement and mrp

+

Please refer to the installation instructions available at: +https://github.com/OCA/contract/agreement_mrp

+
+
+

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 Field Service 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
  • +
+
+ +
+

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_repair/views/agreement_view.xml b/agreement_repair/views/agreement_view.xml new file mode 100644 index 00000000..6f318241 --- /dev/null +++ b/agreement_repair/views/agreement_view.xml @@ -0,0 +1,41 @@ + + + + + Repair Orders + ir.actions.act_window + mrp.repair + form + tree,form + [('agreement_id', '=', active_id)] + +

+ Create Repair Orders +

+
+
+ + + agreement.form.repair + agreement + + + + + + + + +
diff --git a/agreement_repair/views/repair_view.xml b/agreement_repair/views/repair_view.xml new file mode 100644 index 00000000..0a052d91 --- /dev/null +++ b/agreement_repair/views/repair_view.xml @@ -0,0 +1,30 @@ + + + + + mrp.repair.form.agreement + mrp.repair + + + + + + + + + + + + mrp.repair.select.agreement + mrp.repair + + + + + + + + + diff --git a/agreement_stock/readme/USAGE.rst b/agreement_stock/readme/USAGE.rst index 697f9a5d..52c8869d 100644 --- a/agreement_stock/readme/USAGE.rst +++ b/agreement_stock/readme/USAGE.rst @@ -7,4 +7,4 @@ To use this module, you need to: * Open the previous agreement * Click on the smart button "Transfers" to see the list of related transfers * Click on the smart button "Stock Moves" to see the list of related stock moves -* Click on the smart button "Lot/SN #" to see the list of related lot/serial numbers \ No newline at end of file +* Click on the smart button "Lot/SN #" to see the list of related lot/serial numbers