From 8b0f324e5992cf200c7b161984706987be632b60 Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Wed, 27 Mar 2019 19:33:16 +0530 Subject: [PATCH] [MIG][12.0] agreement_maintenance --- agreement_maintenance/README.rst | 7 ++++--- agreement_maintenance/__manifest__.py | 4 ++-- agreement_maintenance/models/agreement.py | 10 +++------- agreement_maintenance/readme/CONTRIBUTORS.rst | 1 + agreement_maintenance/static/description/index.html | 4 ++-- agreement_maintenance/views/agreement_view.xml | 2 +- .../views/maintenance_request_view.xml | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/agreement_maintenance/README.rst b/agreement_maintenance/README.rst index 482cc501..91987dbb 100644 --- a/agreement_maintenance/README.rst +++ b/agreement_maintenance/README.rst @@ -14,13 +14,13 @@ Maintenance Agreements :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_maintenance + :target: https://github.com/OCA/contract/tree/12.0/agreement_maintenance :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_maintenance :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| @@ -82,6 +82,7 @@ Contributors * Bhavesh Odedra * Wolfgang Hall * Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. Other credits ~~~~~~~~~~~~~ @@ -112,6 +113,6 @@ Current `maintainer `__: |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_maintenance/__manifest__.py b/agreement_maintenance/__manifest__.py index 3fef7447..b62ede72 100644 --- a/agreement_maintenance/__manifest__.py +++ b/agreement_maintenance/__manifest__.py @@ -10,10 +10,10 @@ 'website': 'https://github.com/OCA/contract', 'category': 'Maintenance', 'license': 'AGPL-3', - 'version': '11.0.0.0.1', + 'version': '12.0.1.0.0', 'depends': [ - 'agreement', 'maintenance', + 'agreement_serviceprofile', ], 'data': [ 'views/agreement_view.xml', diff --git a/agreement_maintenance/models/agreement.py b/agreement_maintenance/models/agreement.py index 5d7ea34d..c5d9458b 100644 --- a/agreement_maintenance/models/agreement.py +++ b/agreement_maintenance/models/agreement.py @@ -12,10 +12,6 @@ class Agreement(models.Model): @api.multi def _compute_mr_count(self): - data = self.env['maintenance.request'].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.mr_count = count_data.get(agreement.id, 0) + for ag_rec in self: + ag_rec.mr_count = self.env['maintenance.request'].search_count( + [('agreement_id', 'in', ag_rec.ids)]) diff --git a/agreement_maintenance/readme/CONTRIBUTORS.rst b/agreement_maintenance/readme/CONTRIBUTORS.rst index 4e2eb061..fd055b01 100644 --- a/agreement_maintenance/readme/CONTRIBUTORS.rst +++ b/agreement_maintenance/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Bhavesh Odedra * Wolfgang Hall * Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. diff --git a/agreement_maintenance/static/description/index.html b/agreement_maintenance/static/description/index.html index f5047798..c26f1f5a 100644 --- a/agreement_maintenance/static/description/index.html +++ b/agreement_maintenance/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

This module allows you to manage maintenance agreements and contracts.

Table of contents

@@ -451,7 +451,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current 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_maintenance/views/agreement_view.xml b/agreement_maintenance/views/agreement_view.xml index c4d28fc7..9cce2735 100644 --- a/agreement_maintenance/views/agreement_view.xml +++ b/agreement_maintenance/views/agreement_view.xml @@ -19,7 +19,7 @@ agreement.form.maintenance.request agreement - +