[MIG][WIP][12.0] agreement_repair

This commit is contained in:
Murtuza Saleh
2019-03-28 19:01:09 +05:30
committed by Vimal Patel
parent 99afe9cff5
commit 38a6258622
10 changed files with 57 additions and 59 deletions

View File

@@ -14,13 +14,13 @@ Agreement - Repair
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github .. |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 :alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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 :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |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 :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -59,7 +59,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20agreement_repair%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/contract/issues/new?body=module:%20agreement_repair%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@@ -75,6 +75,7 @@ Contributors
~~~~~~~~~~~~ ~~~~~~~~~~~~
* Sandip Mangukiya <smangukiya@opensourceintegrators.com> * Sandip Mangukiya <smangukiya@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
Other credits Other credits
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@@ -107,6 +108,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-smangukiya| |maintainer-max3903| |maintainer-smangukiya| |maintainer-max3903|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/11.0/agreement_repair>`_ project on GitHub. This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/12.0/agreement_repair>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,14 +4,14 @@
{ {
'name': 'Agreement - Repair', 'name': 'Agreement - Repair',
'summary': 'Link repair orders to an agreement', 'summary': 'Link repair orders to an agreement',
'version': '11.0.0.0.1', 'version': '12.0.1.0.0',
'category': 'Contract', 'category': 'Contract',
'author': 'Open Source Integrators, ' 'author': 'Open Source Integrators, '
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/contract', 'website': 'https://github.com/OCA/contract',
'depends': [ 'depends': [
'agreement', 'agreement_serviceprofile',
'mrp_repair', 'repair',
], ],
'data': [ 'data': [
'views/agreement_view.xml', 'views/agreement_view.xml',

View File

@@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 11.0\n" "Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
@@ -14,28 +14,29 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_agreement_repair_count #: model:ir.model.fields,field_description:agreement_repair.field_agreement__repair_count
msgid "# Repair Orders" msgid "# Repair Orders"
msgstr "" msgstr ""
#. module: agreement_repair #. module: agreement_repair
#: model:ir.ui.view,arch_db:agreement_repair.partner_agreement_form_view_repair #: model_terms:ir.ui.view,arch_db:agreement_repair.partner_agreement_form_view_repair
msgid "<span class=\"o_stat_text\">Repair Orders</span>" msgid "<span class=\"o_stat_text\">Repair Orders</span>"
msgstr "" msgstr ""
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_mrp_repair_agreement_id #: model:ir.model,name:agreement_repair.model_agreement
#: model:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_agreement #: model:ir.model.fields,field_description:agreement_repair.field_repair_order__agreement_id
#: model_terms:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_agreement
msgid "Agreement" msgid "Agreement"
msgstr "" msgstr ""
#. module: agreement_repair #. module: agreement_repair
#: model:ir.actions.act_window,help:agreement_repair.action_mrp_repair_agreement_specific #: model_terms:ir.actions.act_window,help:agreement_repair.action_mrp_repair_agreement_specific
msgid "Create Repair Orders" msgid "Create Repair Orders"
msgstr "" msgstr ""
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model,name:agreement_repair.model_mrp_repair #: model:ir.model,name:agreement_repair.model_repair_order
msgid "Repair Order" msgid "Repair Order"
msgstr "" msgstr ""
@@ -45,13 +46,8 @@ msgid "Repair Orders"
msgstr "" msgstr ""
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_mrp_repair_serviceprofile_id #: model:ir.model.fields,field_description:agreement_repair.field_repair_order__serviceprofile_id
#: model:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_filter_agreement #: model_terms:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_filter_agreement
msgid "Service Profile" msgid "Service Profile"
msgstr "" msgstr ""
#. module: agreement_repair
#: model:ir.model,name:agreement_repair.model_agreement
msgid "agreement"
msgstr ""

View File

@@ -1,6 +1,6 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * agreement_repair # * agreement_repair
# #
msgid "" msgid ""
msgstr "" msgstr ""
@@ -17,28 +17,29 @@ msgstr ""
"X-Generator: Weblate 3.3\n" "X-Generator: Weblate 3.3\n"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_agreement_repair_count #: model:ir.model.fields,field_description:agreement_repair.field_agreement__repair_count
msgid "# Repair Orders" msgid "# Repair Orders"
msgstr "# Reparaturaufträge" msgstr "# Reparaturaufträge"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.ui.view,arch_db:agreement_repair.partner_agreement_form_view_repair #: model_terms:ir.ui.view,arch_db:agreement_repair.partner_agreement_form_view_repair
msgid "<span class=\"o_stat_text\">Repair Orders</span>" msgid "<span class=\"o_stat_text\">Repair Orders</span>"
msgstr "<span class=\"o_stat_text\">Reparaturaufträge</span>" msgstr "<span class=\"o_stat_text\">Reparaturaufträge</span>"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_mrp_repair_agreement_id #: model:ir.model,name:agreement_repair.model_agreement
#: model:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_agreement #: model:ir.model.fields,field_description:agreement_repair.field_repair_order__agreement_id
#: model_terms:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_agreement
msgid "Agreement" msgid "Agreement"
msgstr "Vereinbarung" msgstr "Vereinbarung"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.actions.act_window,help:agreement_repair.action_mrp_repair_agreement_specific #: model_terms:ir.actions.act_window,help:agreement_repair.action_mrp_repair_agreement_specific
msgid "Create Repair Orders" msgid "Create Repair Orders"
msgstr "Reparaturaufträge anlegen" msgstr "Reparaturaufträge anlegen"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model,name:agreement_repair.model_mrp_repair #: model:ir.model,name:agreement_repair.model_repair_order
msgid "Repair Order" msgid "Repair Order"
msgstr "Reparaturauftrag" msgstr "Reparaturauftrag"
@@ -48,12 +49,10 @@ msgid "Repair Orders"
msgstr "Reparaturaufträge" msgstr "Reparaturaufträge"
#. module: agreement_repair #. module: agreement_repair
#: model:ir.model.fields,field_description:agreement_repair.field_mrp_repair_serviceprofile_id #: model:ir.model.fields,field_description:agreement_repair.field_repair_order__serviceprofile_id
#: model:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_filter_agreement #: model_terms:ir.ui.view,arch_db:agreement_repair.view_repair_order_form_filter_agreement
msgid "Service Profile" msgid "Service Profile"
msgstr "Dienstleistungsprofil" msgstr "Dienstleistungsprofil"
#. module: agreement_repair #~ msgid "agreement"
#: model:ir.model,name:agreement_repair.model_agreement #~ msgstr "Vereinbarung"
msgid "agreement"
msgstr "Vereinbarung"

View File

@@ -12,10 +12,6 @@ class Agreement(models.Model):
@api.multi @api.multi
def _compute_repair_count(self): def _compute_repair_count(self):
data = self.env['mrp.repair'].read_group( for ag_rec in self:
[('agreement_id', 'in', self.ids)], ag_rec.repair_count = self.env['repair.order'].search_count(
['agreement_id'], ['agreement_id']) [('agreement_id', 'in', ag_rec.ids)])
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)

View File

@@ -4,8 +4,8 @@
from odoo import fields, models from odoo import fields, models
class MRPRepair(models.Model): class Repair(models.Model):
_inherit = "mrp.repair" _inherit = "repair.order"
agreement_id = fields.Many2one('agreement', 'Agreement') agreement_id = fields.Many2one('agreement', 'Agreement')
serviceprofile_id = fields.Many2one('agreement.serviceprofile', serviceprofile_id = fields.Many2one('agreement.serviceprofile',

View File

@@ -1 +1,2 @@
* Sandip Mangukiya <smangukiya@opensourceintegrators.com> * Sandip Mangukiya <smangukiya@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Agreement - Repair</title> <title>Agreement - Repair</title>
<style type="text/css"> <style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/contract/tree/11.0/agreement_repair"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_repair"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/contract/tree/12.0/agreement_repair"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_repair"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Odoo Agreement App does not provide an easy way to access repair orders related to an agreement. <p>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.</p> Some organizations needs to have a quick access to repair orders to track the performance of an agreement.</p>
<p>This module allows you to link a repair order to an agreement and <p>This module allows you to link a repair order to an agreement and
@@ -408,7 +408,7 @@ adds a smart button on the agreement to look at the list of related repair order
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20agreement_repair%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20agreement_repair%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -423,6 +423,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<h2><a class="toc-backref" href="#id6">Contributors</a></h2> <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Sandip Mangukiya &lt;<a class="reference external" href="mailto:smangukiya&#64;opensourceintegrators.com">smangukiya&#64;opensourceintegrators.com</a>&gt;</li> <li>Sandip Mangukiya &lt;<a class="reference external" href="mailto:smangukiya&#64;opensourceintegrators.com">smangukiya&#64;opensourceintegrators.com</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="other-credits"> <div class="section" id="other-credits">
@@ -441,7 +442,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/smangukiya"><img alt="smangukiya" src="https://github.com/smangukiya.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p> <p><a class="reference external" href="https://github.com/smangukiya"><img alt="smangukiya" src="https://github.com/smangukiya.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/11.0/agreement_repair">OCA/contract</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/12.0/agreement_repair">OCA/contract</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record model="ir.actions.act_window" <record id="action_mrp_repair_agreement_specific"
id="action_mrp_repair_agreement_specific"> model="ir.actions.act_window">
<field name="name">Repair Orders</field> <field name="name">Repair Orders</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field> <field name="res_model">repair.order</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
<field name="domain">[('agreement_id', '=', active_id)]</field> <field name="domain">[('agreement_id', '=', active_id)]</field>
<field name="context">{'create': False, 'edit': False}</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">
Create Repair Orders Create Repair Orders
@@ -19,7 +20,8 @@
<record id="partner_agreement_form_view_repair" model="ir.ui.view"> <record id="partner_agreement_form_view_repair" model="ir.ui.view">
<field name="name">agreement.form.repair</field> <field name="name">agreement.form.repair</field>
<field name="model">agreement</field> <field name="model">agreement</field>
<field name="inherit_id" ref="agreement.partner_agreement_form_view"/> <field name="inherit_id"
ref="agreement_legal.partner_agreement_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(action_mrp_repair_agreement_specific)d" <button name="%(action_mrp_repair_agreement_specific)d"

View File

@@ -2,9 +2,9 @@
<odoo> <odoo>
<record id="view_repair_order_form_agreement" model="ir.ui.view"> <record id="view_repair_order_form_agreement" model="ir.ui.view">
<field name="name">mrp.repair.form.agreement</field> <field name="name">repair.order.form.agreement</field>
<field name="model">mrp.repair</field> <field name="model">repair.order</field>
<field name="inherit_id" ref="mrp_repair.view_repair_order_form"/> <field name="inherit_id" ref="repair.view_repair_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<notebook position="inside"> <notebook position="inside">
<page string="Agreement"> <page string="Agreement">
@@ -24,12 +24,14 @@
<!-- Inherit mrp repair search view--> <!-- Inherit mrp repair search view-->
<record id="view_repair_order_form_filter_agreement" model="ir.ui.view"> <record id="view_repair_order_form_filter_agreement" model="ir.ui.view">
<field name="name">mrp.repair.select.agreement</field> <field name="name">repair.order.select.agreement</field>
<field name="model">mrp.repair</field> <field name="model">repair.order</field>
<field name="inherit_id" ref="mrp_repair.view_repair_order_form_filter"/> <field name="inherit_id"
ref="repair.view_repair_order_form_filter"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//group" position="inside"> <xpath expr="//group" position="inside">
<filter string="Service Profile" domain="[]" <filter string="Service Profile" name="serviceprofile_id"
domain="[]"
context="{'group_by':'serviceprofile_id'}"/> context="{'group_by':'serviceprofile_id'}"/>
</xpath> </xpath>
</field> </field>