[14.0][FIX] Travis.

This commit is contained in:
Chanakya Soni
2021-06-25 18:24:17 +05:30
committed by Patrick Wilson
parent c38cf46596
commit 149da0f03f
7 changed files with 90 additions and 75 deletions

View File

@@ -2,26 +2,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Agreement - Stock',
'summary': 'Link picking 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',
'stock',
"name": "Agreement - Stock",
"summary": "Link picking 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",
"stock",
],
'data': [
'views/agreement_view.xml',
'views/stock_view.xml',
"data": [
"views/agreement_view.xml",
"views/stock_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,25 +7,27 @@ from odoo import api, fields, models
class Agreement(models.Model):
_inherit = "agreement"
picking_count = fields.Integer('# Pickings',
compute='_compute_picking_count')
move_count = fields.Integer('# Moves', compute='_compute_move_count')
lot_count = fields.Integer('# Lots/Serials', compute='_compute_lot_count')
picking_count = fields.Integer("# Pickings", compute="_compute_picking_count")
move_count = fields.Integer("# Moves", compute="_compute_move_count")
lot_count = fields.Integer("# Lots/Serials", compute="_compute_lot_count")
@api.multi
def _compute_picking_count(self):
for ag_rec in self:
ag_rec.picking_count = self.env['stock.picking'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.picking_count = self.env["stock.picking"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)
@api.multi
def _compute_move_count(self):
for ag_rec in self:
ag_rec.move_count = self.env['stock.move'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.move_count = self.env["stock.move"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)
@api.multi
def _compute_lot_count(self):
for ag_rec in self:
ag_rec.lot_count = self.env['stock.production.lot'].search_count(
[('agreement_id', 'in', ag_rec.ids)])
ag_rec.lot_count = self.env["stock.production.lot"].search_count(
[("agreement_id", "in", ag_rec.ids)]
)

View File

@@ -7,21 +7,19 @@ from odoo import fields, models
class StockPicking(models.Model):
_inherit = "stock.picking"
agreement_id = fields.Many2one('agreement', 'Agreement')
agreement_id = fields.Many2one("agreement", "Agreement")
class StockMove(models.Model):
_inherit = "stock.move"
agreement_id = fields.Many2one('agreement',
related='picking_id.agreement_id',
string='Agreement',
store=True)
agreement_id = fields.Many2one(
"agreement", related="picking_id.agreement_id", string="Agreement", store=True
)
class StockProductionLot(models.Model):
_inherit = "stock.production.lot"
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_stock_picking_agreement_specific"
model="ir.actions.act_window">
<record id="action_stock_picking_agreement_specific" model="ir.actions.act_window">
<field name="name">Pickings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.picking</field>
@@ -16,8 +15,7 @@
</p>
</field>
</record>
<record id="action_stock_move_agreement_specific"
model="ir.actions.act_window">
<record id="action_stock_move_agreement_specific" model="ir.actions.act_window">
<field name="name">Moves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move</field>
@@ -31,8 +29,10 @@
</p>
</field>
</record>
<record id="action_stock_production_lot_agreement_specific"
model="ir.actions.act_window">
<record
id="action_stock_production_lot_agreement_specific"
model="ir.actions.act_window"
>
<field name="name">Lots/Serials</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.production.lot</field>
@@ -50,39 +50,44 @@
<record id="partner_agreement_form_view_stock" model="ir.ui.view">
<field name="name">agreement.form.stock</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_stock_picking_agreement_specific)d"
<button
name="%(action_stock_picking_agreement_specific)d"
type="action"
class="oe_stat_button" icon="fa-truck">
class="oe_stat_button"
icon="fa-truck"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="picking_count" widget="statinfo"
nolabel="1"/>
<field name="picking_count" widget="statinfo" nolabel="1" />
</span>
<span class="o_stat_text">Pickings</span>
</div>
</button>
<button name="%(action_stock_move_agreement_specific)d"
<button
name="%(action_stock_move_agreement_specific)d"
type="action"
class="oe_stat_button" icon="fa-arrows-v">
class="oe_stat_button"
icon="fa-arrows-v"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="move_count" widget="statinfo"
nolabel="1"/>
<field name="move_count" widget="statinfo" nolabel="1" />
</span>
<span class="o_stat_text">Moves</span>
</div>
</button>
<button name="%(action_stock_production_lot_agreement_specific)d"
<button
name="%(action_stock_production_lot_agreement_specific)d"
type="action"
class="oe_stat_button" icon="fa-arrows">
class="oe_stat_button"
icon="fa-arrows"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="lot_count" widget="statinfo"
nolabel="1"/>
<field name="lot_count" widget="statinfo" nolabel="1" />
</span>
<span class="o_stat_text">Lots/Serials</span>
</div>

View File

@@ -7,8 +7,7 @@
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="origin" position="before">
<field name="agreement_id"
domain="[('partner_id', '=', partner_id)]"/>
<field name="agreement_id" domain="[('partner_id', '=', partner_id)]" />
</field>
</field>
</record>
@@ -32,8 +31,10 @@
<xpath expr="//group[@name='main_group']" position="inside">
<group>
<field name="agreement_id" />
<field name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"/>
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</group>
</xpath>
</field>
@@ -46,9 +47,12 @@
<field name="inherit_id" ref="stock.search_product_lot_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_stock

View File

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