Skip to content

Commit

Permalink
[14.0][MIG]agreement_mrp: Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
vimalpatelserpentcs authored and Murtaza-SerpentCS committed Sep 23, 2021
1 parent 749f80c commit fda0289
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 44 deletions.
37 changes: 18 additions & 19 deletions agreement_mrp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
}
7 changes: 4 additions & 3 deletions agreement_mrp/models/agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
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)]
)
5 changes: 2 additions & 3 deletions agreement_mrp/models/mrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
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")
20 changes: 10 additions & 10 deletions agreement_mrp/views/agreement_view.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?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>
Expand All @@ -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"
type="action"
class="oe_stat_button" icon="fa-wrench">
<button
name="%(action_mrp_production_agreement_specific)d"
type="action"
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>
Expand Down
23 changes: 14 additions & 9 deletions agreement_mrp/views/mrp_view.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="mrp_production_form_view_agreement" model="ir.ui.view">
<field name="name">mrp.production.form.agreement</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
<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="agreement_id" />
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</xpath>
</field>
</record>
Expand All @@ -18,12 +20,15 @@
<record id="view_mrp_production_filter_agreement" model="ir.ui.view">
<field name="name">mrp.production.select.agreement</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.view_mrp_production_filter"/>
<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"
domain="[]"
context="{'group_by':'serviceprofile_id'}"/>
<filter
string="Service Profile"
name="serviceprofile_id"
domain="[]"
context="{'group_by':'serviceprofile_id'}"
/>
</xpath>
</field>
</record>
Expand Down
1 change: 1 addition & 0 deletions setup/agreement_mrp/odoo/addons/agreement_mrp
6 changes: 6 additions & 0 deletions setup/agreement_mrp/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit fda0289

Please sign in to comment.