Browse Source

[MIG][WIP][12.0] agreement_repair

pull/297/head
Murtuza Saleh 6 years ago
parent
commit
cc48d25836
  1. 9
      agreement_repair/README.rst
  2. 6
      agreement_repair/__manifest__.py
  3. 10
      agreement_repair/models/agreement.py
  4. 4
      agreement_repair/models/repair.py
  5. 1
      agreement_repair/readme/CONTRIBUTORS.rst
  6. 4
      agreement_repair/static/description/index.html
  7. 10
      agreement_repair/views/agreement_view.xml
  8. 16
      agreement_repair/views/repair_view.xml

9
agreement_repair/README.rst

@ -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|
@ -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.

6
agreement_repair/__manifest__.py

@ -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',
'mrp_repair',
'agreement_serviceprofile',
'repair',
], ],
'data': [ 'data': [
'views/agreement_view.xml', 'views/agreement_view.xml',

10
agreement_repair/models/agreement.py

@ -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(
[('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)])

4
agreement_repair/models/repair.py

@ -4,8 +4,8 @@
from odoo import fields, models 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') agreement_id = fields.Many2one('agreement', 'Agreement')
serviceprofile_id = fields.Many2one('agreement.serviceprofile', serviceprofile_id = fields.Many2one('agreement.serviceprofile',

1
agreement_repair/readme/CONTRIBUTORS.rst

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

4
agreement_repair/static/description/index.html

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

10
agreement_repair/views/agreement_view.xml

@ -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"
id="action_mrp_repair_agreement_specific">
<record 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"

16
agreement_repair/views/repair_view.xml

@ -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="model">mrp.repair</field>
<field name="inherit_id" ref="mrp_repair.view_repair_order_form"/>
<field name="name">repair.order.form.agreement</field>
<field name="model">repair.order</field>
<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="model">mrp.repair</field>
<field name="inherit_id" ref="mrp_repair.view_repair_order_form_filter"/>
<field name="name">repair.order.select.agreement</field>
<field name="model">repair.order</field>
<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>

Loading…
Cancel
Save