diff --git a/agreement_repair/README.rst b/agreement_repair/README.rst index 6eb68d62..265cc150 100644 --- a/agreement_repair/README.rst +++ b/agreement_repair/README.rst @@ -14,13 +14,13 @@ Agreement - Repair :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/11.0/agreement_repair + :target: https://github.com/OCA/contract/tree/12.0/agreement_repair :alt: OCA/contract .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_repair + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_repair :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/11.0 + :target: https://runbot.odoo-community.org/runbot/110/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -75,6 +75,7 @@ Contributors ~~~~~~~~~~~~ * Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. Other credits ~~~~~~~~~~~~~ @@ -107,6 +108,6 @@ Current `maintainers `__: |maintainer-smangukiya| |maintainer-max3903| -This module is part of the `OCA/contract `_ project on GitHub. +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/__manifest__.py b/agreement_repair/__manifest__.py index 50d310d4..d4a222ad 100644 --- a/agreement_repair/__manifest__.py +++ b/agreement_repair/__manifest__.py @@ -4,14 +4,14 @@ { 'name': 'Agreement - Repair', 'summary': 'Link repair orders to an agreement', - 'version': '11.0.0.0.1', + 'version': '12.0.1.0.0', 'category': 'Contract', 'author': 'Open Source Integrators, ' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/contract', 'depends': [ - 'agreement', - 'mrp_repair', + 'agreement_serviceprofile', + 'repair', ], 'data': [ 'views/agreement_view.xml', diff --git a/agreement_repair/models/agreement.py b/agreement_repair/models/agreement.py index f47a4492..b05c85b6 100644 --- a/agreement_repair/models/agreement.py +++ b/agreement_repair/models/agreement.py @@ -12,10 +12,6 @@ class Agreement(models.Model): @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) + for ag_rec in self: + ag_rec.repair_count = self.env['repair.order'].search_count( + [('agreement_id', 'in', ag_rec.ids)]) diff --git a/agreement_repair/models/repair.py b/agreement_repair/models/repair.py index fa8fecea..ea77a91f 100644 --- a/agreement_repair/models/repair.py +++ b/agreement_repair/models/repair.py @@ -4,8 +4,8 @@ from odoo import fields, models -class MRPRepair(models.Model): - _inherit = "mrp.repair" +class Repair(models.Model): + _inherit = "repair.order" agreement_id = fields.Many2one('agreement', 'Agreement') serviceprofile_id = fields.Many2one('agreement.serviceprofile', diff --git a/agreement_repair/readme/CONTRIBUTORS.rst b/agreement_repair/readme/CONTRIBUTORS.rst index a76235f8..373b2a6a 100644 --- a/agreement_repair/readme/CONTRIBUTORS.rst +++ b/agreement_repair/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. diff --git a/agreement_repair/static/description/index.html b/agreement_repair/static/description/index.html index c4a06b39..426de56b 100644 --- a/agreement_repair/static/description/index.html +++ b/agreement_repair/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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 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 @@ -441,7 +441,7 @@ 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.

+

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 index 0c6c5562..6dbe5b0e 100644 --- a/agreement_repair/views/agreement_view.xml +++ b/agreement_repair/views/agreement_view.xml @@ -1,14 +1,15 @@ - + Repair Orders ir.actions.act_window - mrp.repair + repair.order form tree,form [('agreement_id', '=', active_id)] + {'create': False, 'edit': False}

Create Repair Orders @@ -19,7 +20,8 @@ agreement.form.repair agreement - +