[14.0][FIX]agreement_repair: Travis

This commit is contained in:
Vimal Patel
2021-07-23 12:52:18 +05:30
parent 70553abea3
commit da904c06bc
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). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Agreement - Repair', "name": "Agreement - Repair",
'summary': 'Link repair orders to an agreement', "summary": "Link repair orders to an agreement",
'version': '12.0.1.0.1', "version": "14.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_serviceprofile",
'agreement_serviceprofile', "repair",
'repair',
], ],
'data': [ "data": [
'views/agreement_view.xml', "views/agreement_view.xml",
'views/repair_view.xml', "views/repair_view.xml",
], ],
'installable': True, "installable": True,
'license': 'AGPL-3', "license": "AGPL-3",
'development_status': 'Beta', "development_status": "Beta",
'maintainers': [ "maintainers": [
'smangukiya', "smangukiya",
'max3903', "max3903",
], ],
} }

View File

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

View File

@@ -7,6 +7,5 @@ from odoo import fields, models
class Repair(models.Model): class Repair(models.Model):
_inherit = "repair.order" _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", "Service Profile")
'Service Profile')

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<record id="action_mrp_repair_agreement_specific" <record id="action_mrp_repair_agreement_specific" model="ir.actions.act_window">
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">repair.order</field> <field name="res_model">repair.order</field>
@@ -20,17 +19,18 @@
<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" <field name="inherit_id" ref="agreement_legal.partner_agreement_form_view" />
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"
type="action" type="action"
class="oe_stat_button" icon="fa-wrench"> class="oe_stat_button"
icon="fa-wrench"
>
<div class="o_field_widget o_stat_info"> <div class="o_field_widget o_stat_info">
<span class="o_stat_value"> <span class="o_stat_value">
<field name="repair_count" widget="statinfo" <field name="repair_count" widget="statinfo" nolabel="1" />
nolabel="1"/>
</span> </span>
<span class="o_stat_text">Repair Orders</span> <span class="o_stat_text">Repair Orders</span>
</div> </div>

View File

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