mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] Total refactorization of quality control modules with new API, README files, and new concepts. WIP of quality_control_tolerance
Merge branch '8.0' of github.com:odoomrp/odoomrp-wip into 8.0 [FIX] quality_control_stock: * File missing * Triggers for product category
This commit is contained in:
committed by
Enrique Martín
parent
42fcda2d2b
commit
1891090bed
10
quality_control_stock_oca/README.rst
Normal file
10
quality_control_stock_oca/README.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
Stock extension for quality control
|
||||
===================================
|
||||
|
||||
This module defines triggers that creates inspections when stock moves are done.
|
||||
|
||||
It also adds some shortcuts on picking and lots to these inspections.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
|
||||
16
quality_control_stock_oca/__init__.py
Normal file
16
quality_control_stock_oca/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import models
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
# Create QC triggers
|
||||
picking_type_ids = registry['stock.picking.type'].search(
|
||||
cr, SUPERUSER_ID, [])
|
||||
for picking_type_id in picking_type_ids:
|
||||
registry['stock.picking.type']._create_qc_trigger(
|
||||
cr, SUPERUSER_ID, picking_type_id)
|
||||
45
quality_control_stock_oca/__openerp__.py
Normal file
45
quality_control_stock_oca/__openerp__.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c)
|
||||
# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
|
||||
# 2014 AvanzOsc (http://www.avanzosc.es)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
"name": "Quality control - Stock",
|
||||
"version": "1.0",
|
||||
"author": "OdooMRP team",
|
||||
"website": "http://www.odoomrp.com",
|
||||
"contributors": [
|
||||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com",
|
||||
],
|
||||
"category": "Quality control",
|
||||
"depends": [
|
||||
'quality_control',
|
||||
'stock',
|
||||
],
|
||||
"data": [
|
||||
'data/quality_control_stock_data.xml',
|
||||
'views/qc_inspection_view.xml',
|
||||
'views/stock_picking_view.xml',
|
||||
'views/stock_production_lot_view.xml',
|
||||
],
|
||||
"post_init_hook": "post_init_hook",
|
||||
"installable": True,
|
||||
"auto_install": True,
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
|
||||
<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_production_lot" model="res.request.link">
|
||||
<field name="name">Lot</field>
|
||||
<field name="object">stock.production.lot</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
94
quality_control_stock_oca/i18n/es.po
Normal file
94
quality_control_stock_oca/i18n/es.po
Normal file
@@ -0,0 +1,94 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * quality_control_stock
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-10 19:26+0000\n"
|
||||
"PO-Revision-Date: 2014-12-10 19:26+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: help:stock.production.lot,qc_inspections:0
|
||||
msgid "Inspections related to this lot."
|
||||
msgstr "Inspecciones relativas a este lote."
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: help:stock.picking,qc_inspections:0
|
||||
msgid "Inspections related to this picking."
|
||||
msgstr "Inspecciones relativas a este albarán."
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:qc.inspection:quality_control_stock.qc_inspection_search_view_picking
|
||||
#: field:qc.inspection,lot:0
|
||||
#: view:qc.inspection.line:quality_control_stock.qc_inspection_line_search_stock_view
|
||||
#: field:qc.inspection.line,lot:0
|
||||
msgid "Lot"
|
||||
msgstr "Lote"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:qc.inspection:quality_control_stock.qc_inspection_search_view_picking
|
||||
#: field:qc.inspection,picking:0
|
||||
#: view:qc.inspection.line:quality_control_stock.qc_inspection_line_search_stock_view
|
||||
#: field:qc.inspection.line,picking:0
|
||||
msgid "Picking"
|
||||
msgstr "Albarán"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: field:qc.trigger,picking_type:0
|
||||
msgid "Picking type"
|
||||
msgstr "Tipo de albarán"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_done
|
||||
msgid "Quality inspection from lot done"
|
||||
msgstr "Inspecciones desde lote realizadas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_passed
|
||||
msgid "Quality inspection from lot passed"
|
||||
msgstr "Inspecciones desde lote pasadas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_done
|
||||
msgid "Quality inspection from picking done"
|
||||
msgstr "Inspecciones desde albarán realizadas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_passed
|
||||
msgid "Quality inspection from picking passed"
|
||||
msgstr "Inspecciones desde albarán realizadas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot
|
||||
msgid "Quality inspections from lot"
|
||||
msgstr "Inspecciones desde lote"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_failed
|
||||
msgid "Quality inspections from lot failed"
|
||||
msgstr "Inspecciones desde lote fallidas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking
|
||||
msgid "Quality inspections from picking"
|
||||
msgstr "Inspecciones desde albarán"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_failed
|
||||
msgid "Quality inspections from picking failed"
|
||||
msgstr "Inspecciones desde albarán falladas"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:stock.picking:quality_control_stock.stock_picking_qc_view
|
||||
#: view:stock.production.lot:quality_control_stock.stock_lot_qc_view
|
||||
msgid "inspections"
|
||||
msgstr "inspecciones"
|
||||
|
||||
99
quality_control_stock_oca/i18n/quality_control_stock.pot
Normal file
99
quality_control_stock_oca/i18n/quality_control_stock.pot
Normal file
@@ -0,0 +1,99 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * quality_control_stock
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-10 19:26+0000\n"
|
||||
"PO-Revision-Date: 2014-12-10 19:26+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: help:stock.production.lot,qc_inspections:0
|
||||
msgid "Inspections related to this lot."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: help:stock.picking,qc_inspections:0
|
||||
msgid "Inspections related to this picking."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:qc.inspection:quality_control_stock.qc_inspection_search_view_putvalid
|
||||
#: field:qc.inspection,lot:0
|
||||
#: view:qc.inspection.line:quality_control_stock.qc_inspection_line_search_stock_view
|
||||
#: field:qc.inspection.line,lot:0
|
||||
msgid "Lot"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.model,name:quality_control_stock.model_stock_production_lot
|
||||
msgid "Lot/Serial"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:qc.inspection:quality_control_stock.qc_inspection_search_view_putvalid
|
||||
#: field:qc.inspection,picking:0
|
||||
#: view:qc.inspection.line:quality_control_stock.qc_inspection_line_search_stock_view
|
||||
#: field:qc.inspection.line,picking:0
|
||||
msgid "Picking"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: field:qc.trigger,picking_type:0
|
||||
msgid "Picking type"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_done
|
||||
msgid "Quality inspection from lot done"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_passed
|
||||
msgid "Quality inspection from lot passed"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_done
|
||||
msgid "Quality inspection from picking done"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_passed
|
||||
msgid "Quality inspection from picking passed"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot
|
||||
msgid "Quality inspections from lot"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_lot_failed
|
||||
msgid "Quality inspections from lot failed"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking
|
||||
msgid "Quality inspections from picking"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: model:ir.actions.act_window,name:quality_control_stock.action_qc_inspection_per_picking_failed
|
||||
msgid "Quality inspections from picking failed"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_stock
|
||||
#: view:stock.picking:quality_control_stock.stock_picking_qc_view
|
||||
#: view:stock.production.lot:quality_control_stock.stock_lot_qc_view
|
||||
msgid "inspections"
|
||||
msgstr ""
|
||||
|
||||
10
quality_control_stock_oca/models/__init__.py
Normal file
10
quality_control_stock_oca/models/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import qc_trigger
|
||||
from . import qc_inspection
|
||||
from . import stock_picking_type
|
||||
from . import stock_picking
|
||||
from . import stock_production_lot
|
||||
68
quality_control_stock_oca/models/qc_inspection.py
Normal file
68
quality_control_stock_oca/models/qc_inspection.py
Normal file
@@ -0,0 +1,68 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class QcInspection(models.Model):
|
||||
_inherit = 'qc.inspection'
|
||||
|
||||
@api.one
|
||||
@api.depends('object_id')
|
||||
def get_picking(self):
|
||||
self.picking = False
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.move':
|
||||
self.picking = self.object_id.picking_id
|
||||
elif self.object_id._name == 'stock.picking':
|
||||
self.picking = self.object_id
|
||||
elif self.object_id._name == 'stock.pack.operation':
|
||||
self.picking = self.object_id.picking_id
|
||||
|
||||
@api.one
|
||||
@api.depends('object_id')
|
||||
def get_lot(self):
|
||||
self.lot = False
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.pack.operation':
|
||||
self.lot = self.object_id.lot_id
|
||||
elif self.object_id._name == 'stock.move':
|
||||
self.lot = self.object_id.lots_id[0]
|
||||
|
||||
@api.one
|
||||
@api.depends('object_id')
|
||||
def _get_product(self):
|
||||
"""Overriden for getting the product from a stock move."""
|
||||
super(QcInspection, self)._get_product()
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.move':
|
||||
self.product = self.object_id.product_id
|
||||
elif self.object_id._name == 'stock.pack.operation':
|
||||
self.product = self.object_id.product_id
|
||||
|
||||
@api.one
|
||||
@api.depends('object_id')
|
||||
def _get_qty(self):
|
||||
super(QcInspection, self)._get_qty()
|
||||
if self.object_id:
|
||||
if self.object_id._name == 'stock.move':
|
||||
self.qty = self.object_id.product_qty
|
||||
elif self.object_id._name == 'stock.pack.operation':
|
||||
self.qty = self.object_id.product_qty
|
||||
|
||||
picking = fields.Many2one(
|
||||
comodel_name="stock.picking", compute="get_picking", store=True)
|
||||
lot = fields.Many2one(
|
||||
comodel_name='stock.production.lot', compute="get_lot", store=True)
|
||||
|
||||
|
||||
class QcInspectionLine(models.Model):
|
||||
_inherit = 'qc.inspection.line'
|
||||
|
||||
picking = fields.Many2one(
|
||||
comodel_name="stock.picking", related="inspection_id.picking",
|
||||
store=True)
|
||||
lot = fields.Many2one(
|
||||
comodel_name="stock.production.lot", related="inspection_id.lot",
|
||||
store=True)
|
||||
12
quality_control_stock_oca/models/qc_trigger.py
Normal file
12
quality_control_stock_oca/models/qc_trigger.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class QcTrigger(models.Model):
|
||||
_inherit = 'qc.trigger'
|
||||
|
||||
picking_type = fields.Many2one(
|
||||
comodel_name="stock.picking.type", readonly=True)
|
||||
49
quality_control_stock_oca/models/stock_picking.py
Normal file
49
quality_control_stock_oca/models/stock_picking.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
@api.one
|
||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
||||
def _count_inspections(self):
|
||||
self.created_inspections = len(self.qc_inspections)
|
||||
self.passed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'success'])
|
||||
self.failed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'failed'])
|
||||
self.done_inspections = (self.passed_inspections +
|
||||
self.failed_inspections)
|
||||
|
||||
qc_inspections = fields.One2many(
|
||||
comodel_name='qc.inspection', inverse_name='picking', copy=False,
|
||||
string='Inspections', help="Inspections related to this picking.")
|
||||
created_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Created inspections")
|
||||
done_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Done inspections")
|
||||
passed_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Inspections OK")
|
||||
failed_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Inspections failed")
|
||||
|
||||
@api.multi
|
||||
def do_transfer(self):
|
||||
res = super(StockPicking, self).do_transfer()
|
||||
inspection_model = self.env['qc.inspection']
|
||||
for operation in self.pack_operation_ids:
|
||||
qc_trigger = self.env['qc.trigger'].search(
|
||||
[('picking_type', '=', self.picking_type_id.id)])
|
||||
tests = set()
|
||||
for model in ['qc.trigger.product_category_line',
|
||||
'qc.trigger.product_template_line',
|
||||
'qc.trigger.product_line']:
|
||||
tests = tests.union(self.env[model].get_test_for_product(
|
||||
qc_trigger, operation.product_id))
|
||||
for test in tests:
|
||||
inspection_model._make_inspection(operation, test)
|
||||
return res
|
||||
41
quality_control_stock_oca/models/stock_picking_type.py
Normal file
41
quality_control_stock_oca/models/stock_picking_type.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class StockPickingType(models.Model):
|
||||
_inherit = 'stock.picking.type'
|
||||
|
||||
@api.multi
|
||||
def _create_qc_trigger(self):
|
||||
qc_trigger = {
|
||||
# Synchronize all translations
|
||||
'name': self.complete_name,
|
||||
'company_id': self.warehouse_id.company_id.id,
|
||||
'picking_type': self.id,
|
||||
}
|
||||
return self.env['qc.trigger'].sudo().create(qc_trigger)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
picking_type = super(StockPickingType, self).create(vals)
|
||||
picking_type._create_qc_trigger()
|
||||
return picking_type
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
res = super(StockPickingType, self).write(vals)
|
||||
if vals.get('name') or vals.get('warehouse_id'):
|
||||
qc_trigger_model = self.env['qc.trigger'].sudo()
|
||||
qc_trigger = qc_trigger_model.search(
|
||||
[('picking_type', '=', self.id)])
|
||||
qc_trigger.name = self.complete_name
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
self.env['qc.trigger'].sudo().search(
|
||||
[('picking_type', '=', self.id)]).unlink()
|
||||
return super(StockPickingType, self).unlink()
|
||||
32
quality_control_stock_oca/models/stock_production_lot.py
Normal file
32
quality_control_stock_oca/models/stock_production_lot.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class StockProductionLot(models.Model):
|
||||
_inherit = 'stock.production.lot'
|
||||
|
||||
@api.one
|
||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
||||
def _count_inspections(self):
|
||||
self.created_inspections = len(self.qc_inspections)
|
||||
self.passed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'success'])
|
||||
self.failed_inspections = len([x for x in self.qc_inspections if
|
||||
x.state == 'failed'])
|
||||
self.done_inspections = (self.passed_inspections +
|
||||
self.failed_inspections)
|
||||
|
||||
qc_inspections = fields.One2many(
|
||||
comodel_name='qc.inspection', inverse_name='lot', copy=False,
|
||||
string='Inspections', help="Inspections related to this lot.")
|
||||
created_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Created inspections")
|
||||
done_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Done inspections")
|
||||
passed_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Inspections OK")
|
||||
failed_inspections = fields.Integer(
|
||||
compute="_count_inspections", string="Inspections failed")
|
||||
BIN
quality_control_stock_oca/static/description/icon.png
Normal file
BIN
quality_control_stock_oca/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
79
quality_control_stock_oca/views/qc_inspection_view.xml
Normal file
79
quality_control_stock_oca/views/qc_inspection_view.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
</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>
|
||||
</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">
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
70
quality_control_stock_oca/views/stock_picking_view.xml
Normal file
70
quality_control_stock_oca/views/stock_picking_view.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<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_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 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="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>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<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_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 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="arch" type="xml">
|
||||
<div class="oe_title" position="after">
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
<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>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user