From 2c7076f1991341209bd89e3419ace8c397ccd5b8 Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Thu, 28 Mar 2019 15:50:51 +0530 Subject: [PATCH] [MIG][WIP][12.0] agreement_mrp --- agreement_mrp/README.rst | 9 +++++---- agreement_mrp/__manifest__.py | 4 ++-- agreement_mrp/models/agreement.py | 10 +++------- agreement_mrp/readme/CONTRIBUTORS.rst | 1 + agreement_mrp/static/description/index.html | 4 ++-- agreement_mrp/views/agreement_view.xml | 7 ++++--- agreement_mrp/views/mrp_view.xml | 3 ++- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/agreement_mrp/README.rst b/agreement_mrp/README.rst index e9bd57b9..d49d5127 100644 --- a/agreement_mrp/README.rst +++ b/agreement_mrp/README.rst @@ -14,13 +14,13 @@ Agreement - MRP :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_mrp + :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-11-0/contract-11-0-agreement_mrp + :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/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_mrp/__manifest__.py b/agreement_mrp/__manifest__.py index 1dc9802e..27492052 100644 --- a/agreement_mrp/__manifest__.py +++ b/agreement_mrp/__manifest__.py @@ -4,13 +4,13 @@ { 'name': 'Agreement - MRP', 'summary': 'Link manufacturing 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', + 'agreement_serviceprofile', 'mrp', ], 'data': [ diff --git a/agreement_mrp/models/agreement.py b/agreement_mrp/models/agreement.py index 09425d2b..3e41c960 100644 --- a/agreement_mrp/models/agreement.py +++ b/agreement_mrp/models/agreement.py @@ -11,10 +11,6 @@ class Agreement(models.Model): @api.multi def _compute_mo_count(self): - data = self.env['mrp.production'].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.mo_count = count_data.get(agreement.id, 0) + 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/readme/CONTRIBUTORS.rst b/agreement_mrp/readme/CONTRIBUTORS.rst index a76235f8..373b2a6a 100644 --- a/agreement_mrp/readme/CONTRIBUTORS.rst +++ b/agreement_mrp/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. diff --git a/agreement_mrp/static/description/index.html b/agreement_mrp/static/description/index.html index b57ce74f..6cb0cdc8 100644 --- a/agreement_mrp/static/description/index.html +++ b/agreement_mrp/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 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.

@@ -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_mrp/views/agreement_view.xml b/agreement_mrp/views/agreement_view.xml index 95e632f5..55bfa101 100644 --- a/agreement_mrp/views/agreement_view.xml +++ b/agreement_mrp/views/agreement_view.xml @@ -1,8 +1,8 @@ - + Manufacture Orders ir.actions.act_window mrp.production @@ -19,7 +19,8 @@ agreement.form.mrp agreement - +