mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[14.0][FIX] Travis.
This commit is contained in:
committed by
Patrick Wilson
parent
c38cf46596
commit
149da0f03f
@@ -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",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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"
|
||||
type="action"
|
||||
class="oe_stat_button" icon="fa-truck">
|
||||
<button
|
||||
name="%(action_stock_picking_agreement_specific)d"
|
||||
type="action"
|
||||
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"
|
||||
type="action"
|
||||
class="oe_stat_button" icon="fa-arrows-v">
|
||||
<button
|
||||
name="%(action_stock_move_agreement_specific)d"
|
||||
type="action"
|
||||
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"
|
||||
type="action"
|
||||
class="oe_stat_button" icon="fa-arrows">
|
||||
<button
|
||||
name="%(action_stock_production_lot_agreement_specific)d"
|
||||
type="action"
|
||||
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>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<record id="stock_picking_form_view_agreement" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.agreement</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<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>
|
||||
@@ -16,10 +15,10 @@
|
||||
<record id="view_move_form_agreement" model="ir.ui.view">
|
||||
<field name="name">stock.move.form.agreement</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_move_form"/>
|
||||
<field name="inherit_id" ref="stock.view_move_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="origin" position="before">
|
||||
<field name="agreement_id"/>
|
||||
<field name="agreement_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -27,13 +26,15 @@
|
||||
<record id="view_production_lot_form_agreement" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.form.agreement</field>
|
||||
<field name="model">stock.production.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form"/>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='main_group']" position="inside">
|
||||
<group>
|
||||
<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)]"
|
||||
/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -43,12 +44,15 @@
|
||||
<record id="search_product_lot_filter_agreement" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.select.agreement</field>
|
||||
<field name="model">stock.production.lot</field>
|
||||
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
|
||||
<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"
|
||||
domain="[]"
|
||||
context="{'group_by':'serviceprofile_id'}"/>
|
||||
<filter
|
||||
string="Service Profile"
|
||||
name="serviceprofile_id"
|
||||
domain="[]"
|
||||
context="{'group_by':'serviceprofile_id'}"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
1
setup/agreement_stock/odoo/addons/agreement_stock
Symbolic link
1
setup/agreement_stock/odoo/addons/agreement_stock
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../agreement_stock
|
||||
6
setup/agreement_stock/setup.py
Normal file
6
setup/agreement_stock/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user