[14.0][MIG]agreement_mrp: Travis

This commit is contained in:
Vimal Patel
2021-07-14 15:11:55 +05:30
committed by Murtaza Mithaiwala
parent 749f80c5b2
commit fda02894fa
7 changed files with 55 additions and 44 deletions

View File

@@ -2,26 +2,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Agreement - MRP',
'summary': 'Link manufacturing 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',
'mrp',
"name": "Agreement - MRP",
"summary": "Link manufacturing 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",
"mrp",
],
'data': [
'views/agreement_view.xml',
'views/mrp_view.xml',
"data": [
"views/agreement_view.xml",
"views/mrp_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,10 +7,11 @@ from odoo import api, fields, models
class Agreement(models.Model):
_inherit = "agreement"
mo_count = fields.Integer('# MOs', compute='_compute_mo_count')
mo_count = fields.Integer("# MOs", compute="_compute_mo_count")
@api.multi
def _compute_mo_count(self):
for ag_rec in self:
ag_rec.mo_count = self.env['mrp.production'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.mo_count = self.env["mrp.production"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)

View File

@@ -7,6 +7,5 @@ from odoo import fields, models
class MRPProduction(models.Model):
_inherit = "mrp.production"
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_production_agreement_specific"
model="ir.actions.act_window">
<record id="action_mrp_production_agreement_specific" model="ir.actions.act_window">
<field name="name">Manufacture Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
@@ -19,17 +18,18 @@
<record id="partner_agreement_form_view" model="ir.ui.view">
<field name="name">agreement.form.mrp</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_production_agreement_specific)d"
<button
name="%(action_mrp_production_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="mo_count" widget="statinfo"
nolabel="1"/>
<field name="mo_count" widget="statinfo" nolabel="1" />
</span>
<span class="o_stat_text">MOs</span>
</div>

View File

@@ -8,8 +8,10 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='bom_id']" position="after">
<field name="agreement_id" />
<field name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"/>
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</xpath>
</field>
</record>
@@ -21,9 +23,12 @@
<field name="inherit_id" ref="mrp.view_mrp_production_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_mrp

View File

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