[14.0][FIX]agreement_repair: Travis

This commit is contained in:
Vimal Patel
2021-07-23 12:52:18 +05:30
committed by Murtaza Mithaiwala
parent b4ff1e44a5
commit fba932226e
7 changed files with 59 additions and 48 deletions

View File

@@ -2,26 +2,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Agreement - Repair',
'summary': 'Link repair orders to an agreement',
'version': '12.0.1.0.1',
'category': 'Contract',
'author': 'Open Source Integrators, '
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/contract',
'depends': [
'agreement_serviceprofile',
'repair',
"name": "Agreement - Repair",
"summary": "Link repair orders to an agreement",
"version": "14.0.1.0.0",
"category": "Contract",
"author": "Open Source Integrators, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/contract",
"depends": [
"agreement_serviceprofile",
"repair",
],
'data': [
'views/agreement_view.xml',
'views/repair_view.xml',
"data": [
"views/agreement_view.xml",
"views/repair_view.xml",
],
'installable': True,
'license': 'AGPL-3',
'development_status': 'Beta',
'maintainers': [
'smangukiya',
'max3903',
"installable": True,
"license": "AGPL-3",
"development_status": "Beta",
"maintainers": [
"smangukiya",
"max3903",
],
}

View File

@@ -7,11 +7,11 @@ from odoo import api, fields, models
class Agreement(models.Model):
_inherit = "agreement"
repair_count = fields.Integer('# Repair Orders',
compute='_compute_repair_count')
repair_count = fields.Integer("# Repair Orders", compute="_compute_repair_count")
@api.multi
def _compute_repair_count(self):
for ag_rec in self:
ag_rec.repair_count = self.env['repair.order'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.repair_count = self.env["repair.order"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)

View File

@@ -7,6 +7,5 @@ from odoo import fields, models
class Repair(models.Model):
_inherit = "repair.order"
agreement_id = fields.Many2one('agreement', 'Agreement')
serviceprofile_id = fields.Many2one('agreement.serviceprofile',
'Service Profile')
agreement_id = fields.Many2one("agreement", "Agreement")
serviceprofile_id = fields.Many2one("agreement.serviceprofile", "Service Profile")

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="action_mrp_repair_agreement_specific"
model="ir.actions.act_window">
<record id="action_mrp_repair_agreement_specific" model="ir.actions.act_window">
<field name="name">Repair Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">repair.order</field>
@@ -20,17 +19,18 @@
<record id="partner_agreement_form_view_repair" model="ir.ui.view">
<field name="name">agreement.form.repair</field>
<field name="model">agreement</field>
<field name="inherit_id"
ref="agreement_legal.partner_agreement_form_view"/>
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view" />
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(action_mrp_repair_agreement_specific)d"
<button
name="%(action_mrp_repair_agreement_specific)d"
type="action"
class="oe_stat_button" icon="fa-wrench">
class="oe_stat_button"
icon="fa-wrench"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="repair_count" widget="statinfo"
nolabel="1"/>
<field name="repair_count" widget="statinfo" nolabel="1" />
</span>
<span class="o_stat_text">Repair Orders</span>
</div>

View File

@@ -10,10 +10,14 @@
<page string="Agreement">
<group>
<group id="agreement-left">
<field name="agreement_id"
domain="[('partner_id', '=', partner_id)]"/>
<field name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"/>
<field
name="agreement_id"
domain="[('partner_id', '=', partner_id)]"
/>
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</group>
<group id="agreement-right" />
</group>
@@ -26,13 +30,15 @@
<record id="view_repair_order_form_filter_agreement" model="ir.ui.view">
<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="inherit_id" ref="repair.view_repair_order_form_filter" />
<field name="arch" type="xml">
<xpath expr="//group" position="inside">
<filter string="Service Profile" name="serviceprofile_id"
<filter
string="Service Profile"
name="serviceprofile_id"
domain="[]"
context="{'group_by':'serviceprofile_id'}"/>
context="{'group_by':'serviceprofile_id'}"
/>
</xpath>
</field>
</record>

View File

@@ -0,0 +1 @@
../../../../agreement_repair

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)