mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control_stock: Migration to 10.0
This commit is contained in:
@@ -1,57 +1,81 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
=======================
|
||||
Quality control - Stock
|
||||
=======================
|
||||
|
||||
===================================
|
||||
Stock extension for quality control
|
||||
===================================
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/manufacture/tree/10.0/quality_control_stock
|
||||
:alt: OCA/manufacture
|
||||
.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/129/10.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4|
|
||||
|
||||
This module defines triggers that creates inspections when stock moves are done.
|
||||
|
||||
It also adds some shortcuts on picking and lots to these inspections.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/129/8.0
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
* Put trigger in all languages.
|
||||
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* OdooMRP team
|
||||
* AvanzOSC
|
||||
* Serv. Tecnol. Avanzados - Pedro M. Baeza
|
||||
* Agile Business Group
|
||||
|
||||
Contributors
|
||||
------------
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
|
||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit http://odoo-community.org.
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/10.0/quality_control_stock>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
from openerp import SUPERUSER_ID
|
||||
from odoo import api, SUPERUSER_ID
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
# Create QC triggers
|
||||
picking_type_ids = registry['stock.picking.type'].search(
|
||||
cr, SUPERUSER_ID, [])
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
picking_type_ids = env['stock.picking.type'].sudo().search([])
|
||||
for picking_type_id in picking_type_ids:
|
||||
registry['stock.picking.type']._create_qc_trigger(
|
||||
cr, SUPERUSER_ID, picking_type_id)
|
||||
picking_type_id.sudo()._create_qc_trigger()
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# (c) 2014 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Quality control - Stock",
|
||||
"version": "8.0.1.0.1",
|
||||
"version": "10.0.1.0.0",
|
||||
"category": "Quality control",
|
||||
"license": "AGPL-3",
|
||||
"author": "OdooMRP team, "
|
||||
"AvanzOSC, "
|
||||
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
||||
"Agile Business Group, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "http://www.odoomrp.com",
|
||||
"contributors": [
|
||||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
|
||||
"Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
|
||||
],
|
||||
"website": "https://github.com/OCA/manufacture/tree/10.0/"
|
||||
"quality_control_stock",
|
||||
"depends": [
|
||||
"quality_control",
|
||||
"stock",
|
||||
@@ -1,21 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="req_link_stock_move" model="res.request.link">
|
||||
<field name="name">Stock Move</field>
|
||||
<field name="object">stock.move</field>
|
||||
</record>
|
||||
|
||||
<data>
|
||||
<record id="req_link_stock_move" model="res.request.link">
|
||||
<field name="name">Stock Move</field>
|
||||
<field name="object">stock.move</field>
|
||||
</record>
|
||||
<record id="req_link_stock_picking" model="res.request.link">
|
||||
<field name="name">Picking List</field>
|
||||
<field name="object">stock.picking</field>
|
||||
</record>
|
||||
|
||||
<record id="req_link_stock_picking" model="res.request.link">
|
||||
<field name="name">Picking List</field>
|
||||
<field name="object">stock.picking</field>
|
||||
</record>
|
||||
|
||||
<record id="req_link_stock_production_lot" model="res.request.link">
|
||||
<field name="name">Lot</field>
|
||||
<field name="object">stock.production.lot</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
<record id="req_link_stock_production_lot" model="res.request.link">
|
||||
<field name="name">Lot</field>
|
||||
<field name="object">stock.production.lot</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import qc_trigger
|
||||
from . import qc_inspection
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class QcInspection(models.Model):
|
||||
_inherit = 'qc.inspection'
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
@api.depends('object_id')
|
||||
def get_picking(self):
|
||||
self.ensure_one()
|
||||
self.picking = False
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.move':
|
||||
@@ -20,22 +22,24 @@ class QcInspection(models.Model):
|
||||
elif self.object_id._name == 'stock.pack.operation':
|
||||
self.picking = self.object_id.picking_id
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
@api.depends('object_id')
|
||||
def get_lot(self):
|
||||
self.ensure_one()
|
||||
self.lot = False
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.pack.operation':
|
||||
self.lot = self.object_id.lot_id
|
||||
self.lot = self.object_id.pack_lot_ids[:1].lot_id
|
||||
elif self.object_id._name == 'stock.move':
|
||||
self.lot = self.object_id.lot_ids[:1]
|
||||
elif self.object_id._name == 'stock.production.lot':
|
||||
self.lot = self.object_id
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
@api.depends('object_id')
|
||||
def _get_product(self):
|
||||
"""Overriden for getting the product from a stock move."""
|
||||
self.ensure_one()
|
||||
super(QcInspection, self)._get_product()
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.move':
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class QcTrigger(models.Model):
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
from openerp.addons.quality_control.models.qc_trigger_line import\
|
||||
from odoo import api, fields, models
|
||||
from odoo.addons.quality_control.models.qc_trigger_line import\
|
||||
_filter_trigger_lines
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
||||
def _count_inspections(self):
|
||||
self.ensure_one()
|
||||
self.created_inspections = len(self.qc_inspections)
|
||||
self.passed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'success'])
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class StockPickingType(models.Model):
|
||||
@@ -10,8 +11,9 @@ class StockPickingType(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _create_qc_trigger(self):
|
||||
self.ensure_one()
|
||||
qc_trigger = {
|
||||
'name': self.complete_name,
|
||||
'name': self.name,
|
||||
'company_id': self.warehouse_id.company_id.id,
|
||||
'picking_type': self.id,
|
||||
'partner_selectable': True,
|
||||
@@ -31,5 +33,5 @@ class StockPickingType(models.Model):
|
||||
qc_trigger_model = self.env['qc.trigger'].sudo()
|
||||
qc_trigger = qc_trigger_model.search(
|
||||
[('picking_type', '=', self.id)])
|
||||
qc_trigger.name = self.complete_name
|
||||
qc_trigger.name = self.name
|
||||
return res
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockProductionLot(models.Model):
|
||||
_inherit = 'stock.production.lot'
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
||||
def _count_inspections(self):
|
||||
self.ensure_one()
|
||||
self.created_inspections = len(self.qc_inspections)
|
||||
self.passed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'success'])
|
||||
|
||||
3
quality_control_stock/readme/CONTRIBUTORS.rst
Normal file
3
quality_control_stock/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
|
||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
3
quality_control_stock/readme/DESCRIPTION.rst
Normal file
3
quality_control_stock/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
This module defines triggers that creates inspections when stock moves are done.
|
||||
|
||||
It also adds some shortcuts on picking and lots to these inspections.
|
||||
1
quality_control_stock/readme/ROADMAP.rst
Normal file
1
quality_control_stock/readme/ROADMAP.rst
Normal file
@@ -0,0 +1 @@
|
||||
* Put trigger in all languages.
|
||||
@@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_quality_control_stock
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests.common import TransactionCase
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestQualityControl(TransactionCase):
|
||||
@@ -18,7 +19,9 @@ class TestQualityControl(TransactionCase):
|
||||
self.partner2 = self.env.ref('base.res_partner_4')
|
||||
self.test = self.env.ref('quality_control.qc_test_1')
|
||||
self.picking_type = self.env.ref('stock.picking_type_out')
|
||||
self.sequence = self.env.ref('stock.seq_type_picking_out')
|
||||
self.location_dest = self.env.ref('stock.stock_location_customers')
|
||||
self.sequence = self.env['ir.sequence'] \
|
||||
.search([('prefix', 'like', '/OUT/')], limit=1)
|
||||
inspection_lines = (
|
||||
self.inspection_model._prepare_inspection_lines(self.test))
|
||||
self.inspection1 = self.inspection_model.create({
|
||||
@@ -37,19 +40,27 @@ class TestQualityControl(TransactionCase):
|
||||
'product_uom': self.product.uom_id.id,
|
||||
'product_uom_qty': 2.0,
|
||||
'location_id': self.picking_type.default_location_src_id.id,
|
||||
'location_dest_id': self.picking_type.default_location_dest_id.id,
|
||||
'location_dest_id': self.location_dest.id,
|
||||
}
|
||||
self.picking1 = self.picking_model.create({
|
||||
'partner_id': self.partner1.id,
|
||||
'picking_type_id': self.picking_type.id,
|
||||
'move_lines': [(0, 0, move_vals)],
|
||||
})
|
||||
self.picking1 = self.picking_model \
|
||||
.with_context(default_picking_type_id=self.picking_type.id) \
|
||||
.create({
|
||||
'partner_id': self.partner1.id,
|
||||
'picking_type_id': self.picking_type.id,
|
||||
'move_lines': [(0, 0, move_vals)],
|
||||
'location_dest_id': self.location_dest.id
|
||||
})
|
||||
self.picking1.action_confirm()
|
||||
self.picking1.force_assign()
|
||||
self.picking1.do_prepare_partial()
|
||||
for line in self.picking1.pack_operation_ids.filtered(
|
||||
lambda r: r.product_id == self.product):
|
||||
line.write({'lot_id': self.lot.id})
|
||||
line.write({
|
||||
'pack_lot_ids': [(0, 0, {
|
||||
'lot_id': self.lot.id,
|
||||
'qty': 2.0
|
||||
})]
|
||||
})
|
||||
|
||||
def test_inspection_create_for_product(self):
|
||||
self.product.qc_triggers = [(
|
||||
@@ -200,24 +211,24 @@ class TestQualityControl(TransactionCase):
|
||||
def test_picking_type(self):
|
||||
picking_type = self.picking_type_model.create({
|
||||
'name': 'Test Picking Type',
|
||||
'sequence_id': self.sequence.id,
|
||||
'code': 'outgoing',
|
||||
'sequence_id': self.sequence.id
|
||||
})
|
||||
trigger = self.qc_trigger_model.search(
|
||||
[('picking_type', '=', picking_type.id)])
|
||||
self.assertEqual(len(trigger), 1,
|
||||
'One trigger must have been created.')
|
||||
self.assertEqual(trigger.name, picking_type.complete_name,
|
||||
self.assertEqual(trigger.name, picking_type.name,
|
||||
'Trigger name must match picking type name.')
|
||||
picking_type.write({
|
||||
'name': 'Test Name Change',
|
||||
})
|
||||
self.assertEqual(trigger.name, picking_type.complete_name,
|
||||
self.assertEqual(trigger.name, picking_type.name,
|
||||
'Trigger name must match picking type name.')
|
||||
|
||||
def test_qc_inspection_picking(self):
|
||||
self.inspection1.write({
|
||||
'object_id': '%s,%d' % (self.picking1._model,
|
||||
'object_id': '%s,%d' % (self.picking1._name,
|
||||
self.picking1.id),
|
||||
})
|
||||
self.assertEquals(self.inspection1.picking,
|
||||
@@ -225,7 +236,7 @@ class TestQualityControl(TransactionCase):
|
||||
|
||||
def test_qc_inspection_stock_move(self):
|
||||
self.inspection1.write({
|
||||
'object_id': '%s,%d' % (self.picking1.move_lines[:1]._model,
|
||||
'object_id': '%s,%d' % (self.picking1.move_lines[:1]._name,
|
||||
self.picking1.move_lines[:1].id),
|
||||
})
|
||||
self.inspection1.onchange_object_id()
|
||||
@@ -240,7 +251,7 @@ class TestQualityControl(TransactionCase):
|
||||
|
||||
def test_qc_inspection_lot(self):
|
||||
self.inspection1.write({
|
||||
'object_id': '%s,%d' % (self.lot._model,
|
||||
'object_id': '%s,%d' % (self.lot._name,
|
||||
self.lot.id),
|
||||
})
|
||||
self.inspection1.onchange_object_id()
|
||||
|
||||
@@ -1,83 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="qc_inspection_form_view_picking">
|
||||
<field name="name">qc.inspection.form.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking" />
|
||||
<field name="lot" groups="stock.group_production_lot" />
|
||||
</field>
|
||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="qc_inspection_form_view_picking">
|
||||
<field name="name">qc.inspection.form.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking"/>
|
||||
<field name="lot" groups="stock.group_production_lot"/>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="qc_inspection_tree_view_picking">
|
||||
<field name="name">qc.inspection.tree.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking" />
|
||||
<field name="lot" groups="stock.group_production_lot" />
|
||||
</field>
|
||||
<record model="ir.ui.view" id="qc_inspection_tree_view_picking">
|
||||
<field name="name">qc.inspection.tree.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking"/>
|
||||
<field name="lot" groups="stock.group_production_lot"/>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="qc_inspection_search_view_picking">
|
||||
<field name="name">qc.inspection.search.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_search_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking" />
|
||||
<field name="lot" groups="stock.group_production_lot" />
|
||||
</field>
|
||||
<filter string="Product" position="after">
|
||||
<filter string="Picking"
|
||||
domain="[]"
|
||||
context="{'group_by': 'picking'}" />
|
||||
<filter string="Lot"
|
||||
domain="[]"
|
||||
groups="stock.group_production_lot"
|
||||
context="{'group_by': 'lot'}" />
|
||||
</filter>
|
||||
<record model="ir.ui.view" id="qc_inspection_search_view_picking">
|
||||
<field name="name">qc.inspection.search.view.picking</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking"/>
|
||||
<field name="lot" groups="stock.group_production_lot"/>
|
||||
</field>
|
||||
</record>
|
||||
<group expand="0" position="inside">
|
||||
<filter string="Picking"
|
||||
domain="[]"
|
||||
context="{'group_by': 'picking'}"/>
|
||||
<filter string="Lot"
|
||||
domain="[]"
|
||||
groups="stock.group_production_lot"
|
||||
context="{'group_by': 'lot'}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="qc_inspection_line_tree_stock_view">
|
||||
<field name="name">qc.inspection.line.tree.stock</field>
|
||||
<field name="model">qc.inspection.line</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking" />
|
||||
<field name="lot" />
|
||||
</field>
|
||||
<record model="ir.ui.view" id="qc_inspection_line_tree_stock_view">
|
||||
<field name="name">qc.inspection.line.tree.stock</field>
|
||||
<field name="model">qc.inspection.line</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking"/>
|
||||
<field name="lot"/>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="qc_inspection_line_search_stock_view">
|
||||
<field name="name">qc.inspection.line.search.stock</field>
|
||||
<field name="model">qc.inspection.line</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_search_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking" />
|
||||
<field name="lot" />
|
||||
</field>
|
||||
<filter string="Product" position="after">
|
||||
<filter string="Picking"
|
||||
domain="[]"
|
||||
context="{'group_by': 'picking'}" />
|
||||
<filter string="Lot"
|
||||
domain="[]"
|
||||
context="{'group_by': 'lot'}" />
|
||||
</filter>
|
||||
<record model="ir.ui.view" id="qc_inspection_line_search_stock_view">
|
||||
<field name="name">qc.inspection.line.search.stock</field>
|
||||
<field name="model">qc.inspection.line</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product" position="after">
|
||||
<field name="picking"/>
|
||||
<field name="lot"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
<group expand="0" position="inside">
|
||||
<filter string="Picking"
|
||||
domain="[]"
|
||||
context="{'group_by': 'picking'}"/>
|
||||
<filter string="Lot"
|
||||
domain="[]"
|
||||
context="{'group_by': 'lot'}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,72 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="action_qc_inspection_per_picking" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from picking</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id)]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_picking" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from picking</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id)]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_picking_done" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from picking done</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_picking_done" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from picking done</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_picking_passed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from picking passed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'success')]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_picking_passed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from picking passed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'success')]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_picking_failed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from picking failed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'failed')]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_picking_failed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from picking failed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'failed')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="stock_picking_qc_view">
|
||||
<field name="name">stock.picking.qc.view</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('quality_control.group_quality_control_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<div class="oe_right oe_button_box" position="inside">
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking)d"
|
||||
icon="fa-list">
|
||||
<field name="created_inspections"
|
||||
widget="statinfo"
|
||||
string="inspections" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_done)d"
|
||||
icon="fa-pencil">
|
||||
<field name="done_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_passed)d"
|
||||
icon="fa-thumbs-o-up">
|
||||
<field name="passed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_failed)d"
|
||||
icon="fa-thumbs-o-down">
|
||||
<field name="failed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
<record model="ir.ui.view" id="stock_picking_qc_view">
|
||||
<field name="name">stock.picking.qc.view</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('quality_control.group_quality_control_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking)d"
|
||||
icon="fa-list">
|
||||
<field name="created_inspections"
|
||||
widget="statinfo"
|
||||
string="inspections" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_done)d"
|
||||
icon="fa-pencil">
|
||||
<field name="done_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_passed)d"
|
||||
icon="fa-thumbs-o-up">
|
||||
<field name="passed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_picking_failed)d"
|
||||
icon="fa-thumbs-o-down">
|
||||
<field name="failed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,72 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="action_qc_inspection_per_lot" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from lot</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id)]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_lot" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from lot</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id)]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_lot_done" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from lot done</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_lot_done" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from lot done</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_lot_passed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from lot passed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'success')]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_lot_passed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspection from lot passed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'success')]</field>
|
||||
</record>
|
||||
<record id="action_qc_inspection_per_lot_failed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from lot failed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'failed')]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_qc_inspection_per_lot_failed" model="ir.actions.act_window">
|
||||
<field name="name">Quality inspections from lot failed</field>
|
||||
<field name="res_model">qc.inspection</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'failed')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="stock_lot_qc_view">
|
||||
<field name="name">stock.production.lot.qc.view</field>
|
||||
<field name="model">stock.production.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form" />
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('quality_control.group_quality_control_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<div class="oe_button_box oe_right" position="inside">
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot)d"
|
||||
icon="fa-list">
|
||||
<field name="created_inspections"
|
||||
widget="statinfo"
|
||||
string="inspections" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_done)d"
|
||||
icon="fa-pencil">
|
||||
<field name="done_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_passed)d"
|
||||
icon="fa-thumbs-o-up">
|
||||
<field name="passed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_failed)d"
|
||||
icon="fa-thumbs-o-down">
|
||||
<field name="failed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
<record model="ir.ui.view" id="stock_lot_qc_view">
|
||||
<field name="name">stock.production.lot.qc.view</field>
|
||||
<field name="model">stock.production.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_form" />
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('quality_control.group_quality_control_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot)d"
|
||||
icon="fa-list">
|
||||
<field name="created_inspections"
|
||||
widget="statinfo"
|
||||
string="inspections" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_done)d"
|
||||
icon="fa-pencil">
|
||||
<field name="done_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_passed)d"
|
||||
icon="fa-thumbs-o-up">
|
||||
<field name="passed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_per_lot_failed)d"
|
||||
icon="fa-thumbs-o-down">
|
||||
<field name="failed_inspections" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user