mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control_stock: Migration to 11.0
This commit is contained in:
committed by
Enrique Martín
parent
4190a02e39
commit
195448dc3a
@@ -14,13 +14,13 @@ Quality control - Stock
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
|
.. |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
|
:target: https://github.com/OCA/manufacture/tree/11.0/quality_control_stock
|
||||||
:alt: OCA/manufacture
|
:alt: OCA/manufacture
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/manufacture-10-0/manufacture-10-0-quality_control_stock
|
:target: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-quality_control_stock
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/129/10.0
|
:target: https://runbot.odoo-community.org/runbot/129/11.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
@@ -66,6 +66,7 @@ Contributors
|
|||||||
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
|
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
|
||||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
||||||
* Simone Rubino <simone.rubino@agilebg.com>
|
* Simone Rubino <simone.rubino@agilebg.com>
|
||||||
|
* Ignacio Ales <ignacio.ales@guadaltech.es>
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
@@ -6,7 +5,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Quality control - Stock",
|
"name": "Quality control - Stock",
|
||||||
"version": "10.0.1.0.2",
|
"version": "11.0.1.0.0",
|
||||||
"category": "Quality control",
|
"category": "Quality control",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "OdooMRP team, "
|
"author": "OdooMRP team, "
|
||||||
@@ -14,7 +13,7 @@
|
|||||||
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
||||||
"Agile Business Group, "
|
"Agile Business Group, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/manufacture/tree/10.0/"
|
"website": "https://github.com/OCA/manufacture/tree/11.0/"
|
||||||
"quality_control_stock",
|
"quality_control_stock",
|
||||||
"depends": [
|
"depends": [
|
||||||
"quality_control",
|
"quality_control",
|
||||||
|
|||||||
@@ -2,18 +2,15 @@
|
|||||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="req_link_stock_move" model="res.request.link">
|
<data noupdate="1">
|
||||||
<field name="name">Stock Move</field>
|
<record id="req_link_stock_move" model="res.request.link">
|
||||||
<field name="object">stock.move</field>
|
<field name="name">Stock Move</field>
|
||||||
</record>
|
<field name="object">stock.move</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="req_link_stock_picking" model="res.request.link">
|
<record id="req_link_stock_picking" model="res.request.link">
|
||||||
<field name="name">Picking List</field>
|
<field name="name">Picking List</field>
|
||||||
<field name="object">stock.picking</field>
|
<field name="object">stock.picking</field>
|
||||||
</record>
|
</record>
|
||||||
|
</data>
|
||||||
<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>
|
</odoo>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from . import qc_trigger
|
from . import qc_trigger
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -13,49 +12,53 @@ class QcInspection(models.Model):
|
|||||||
@api.depends('object_id')
|
@api.depends('object_id')
|
||||||
def _compute_picking(self):
|
def _compute_picking(self):
|
||||||
for inspection in self:
|
for inspection in self:
|
||||||
inspection.picking = False
|
inspection.picking_id = False
|
||||||
if inspection.object_id:
|
if inspection.object_id:
|
||||||
if inspection.object_id._name == 'stock.move':
|
if inspection.object_id._name == 'stock.move':
|
||||||
inspection.picking = inspection.object_id.picking_id
|
inspection.picking_id = inspection.object_id.picking_id
|
||||||
elif inspection.object_id._name == 'stock.picking':
|
elif inspection.object_id._name == 'stock.picking':
|
||||||
inspection.picking = inspection.object_id
|
inspection.picking_id = inspection.object_id
|
||||||
elif inspection.object_id._name == 'stock.pack.operation':
|
elif inspection.object_id._name == 'stock.move.line':
|
||||||
inspection.picking = inspection.object_id.picking_id
|
inspection.picking_id = inspection.object_id.picking_id
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('object_id')
|
@api.depends('object_id')
|
||||||
def _compute_lot(self):
|
def _compute_lot(self):
|
||||||
for inspection in self:
|
for inspection in self:
|
||||||
inspection.lot = False
|
inspection.lot_id = False
|
||||||
if inspection.object_id:
|
if inspection.object_id:
|
||||||
if inspection.object_id._name == 'stock.pack.operation':
|
if inspection.object_id._name == 'stock.move.line':
|
||||||
inspection.lot = \
|
inspection.lot_id = \
|
||||||
inspection.object_id.pack_lot_ids[:1].lot_id
|
inspection.object_id.lot_id
|
||||||
elif inspection.object_id._name == 'stock.move':
|
elif inspection.object_id._name == 'stock.move':
|
||||||
inspection.lot = inspection.object_id.lot_ids[:1]
|
inspection.lot_id = \
|
||||||
|
self.env['stock.move.line'].search([
|
||||||
|
('lot_id', '!=', False),
|
||||||
|
('move_id', '=', inspection.object_id.id)
|
||||||
|
])[:1].lot_id
|
||||||
elif inspection.object_id._name == 'stock.production.lot':
|
elif inspection.object_id._name == 'stock.production.lot':
|
||||||
inspection.lot = inspection.object_id
|
inspection.lot_id = inspection.object_id
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('object_id')
|
@api.depends('object_id')
|
||||||
def _get_product(self):
|
def _compute_product_id(self):
|
||||||
"""Overriden for getting the product from a stock move."""
|
"""Overriden for getting the product from a stock move."""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
super(QcInspection, self)._get_product()
|
super(QcInspection, self)._compute_product_id()
|
||||||
if self.object_id:
|
if self.object_id:
|
||||||
if self.object_id._name == 'stock.move':
|
if self.object_id._name == 'stock.move':
|
||||||
self.product = self.object_id.product_id
|
self.product_id = self.object_id.product_id
|
||||||
elif self.object_id._name == 'stock.pack.operation':
|
elif self.object_id._name == 'stock.move.line':
|
||||||
self.product = self.object_id.product_id
|
self.product_id = self.object_id.product_id
|
||||||
elif self.object_id._name == 'stock.production.lot':
|
elif self.object_id._name == 'stock.production.lot':
|
||||||
self.product = self.object_id.product_id
|
self.product_id = self.object_id.product_id
|
||||||
|
|
||||||
@api.onchange('object_id')
|
@api.onchange('object_id')
|
||||||
def onchange_object_id(self):
|
def onchange_object_id(self):
|
||||||
if self.object_id:
|
if self.object_id:
|
||||||
if self.object_id._name == 'stock.move':
|
if self.object_id._name == 'stock.move':
|
||||||
self.qty = self.object_id.product_qty
|
self.qty = self.object_id.product_qty
|
||||||
elif self.object_id._name == 'stock.pack.operation':
|
elif self.object_id._name == 'stock.move.line':
|
||||||
self.qty = self.object_id.product_qty
|
self.qty = self.object_id.product_qty
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -63,15 +66,15 @@ class QcInspection(models.Model):
|
|||||||
res = super(QcInspection, self)._prepare_inspection_header(
|
res = super(QcInspection, self)._prepare_inspection_header(
|
||||||
object_ref, trigger_line)
|
object_ref, trigger_line)
|
||||||
# Fill qty when coming from pack operations
|
# Fill qty when coming from pack operations
|
||||||
if object_ref and object_ref._name == 'stock.pack.operation':
|
if object_ref and object_ref._name == 'stock.move.line':
|
||||||
res['qty'] = object_ref.product_qty
|
res['qty'] = object_ref.product_qty
|
||||||
if object_ref and object_ref._name == 'stock.move':
|
if object_ref and object_ref._name == 'stock.move':
|
||||||
res['qty'] = object_ref.product_uom_qty
|
res['qty'] = object_ref.product_uom_qty
|
||||||
return res
|
return res
|
||||||
|
|
||||||
picking = fields.Many2one(
|
picking_id = fields.Many2one(
|
||||||
comodel_name="stock.picking", compute="_compute_picking", store=True)
|
comodel_name="stock.picking", compute="_compute_picking", store=True)
|
||||||
lot = fields.Many2one(
|
lot_id = fields.Many2one(
|
||||||
comodel_name='stock.production.lot', compute="_compute_lot",
|
comodel_name='stock.production.lot', compute="_compute_lot",
|
||||||
store=True)
|
store=True)
|
||||||
|
|
||||||
@@ -79,9 +82,9 @@ class QcInspection(models.Model):
|
|||||||
class QcInspectionLine(models.Model):
|
class QcInspectionLine(models.Model):
|
||||||
_inherit = 'qc.inspection.line'
|
_inherit = 'qc.inspection.line'
|
||||||
|
|
||||||
picking = fields.Many2one(
|
picking_id = fields.Many2one(
|
||||||
comodel_name="stock.picking", related="inspection_id.picking",
|
comodel_name="stock.picking", related="inspection_id.picking_id",
|
||||||
store=True)
|
store=True)
|
||||||
lot = fields.Many2one(
|
lot_id = fields.Many2one(
|
||||||
comodel_name="stock.production.lot", related="inspection_id.lot",
|
comodel_name="stock.production.lot", related="inspection_id.lot_id",
|
||||||
store=True)
|
store=True)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -9,5 +8,5 @@ from odoo import fields, models
|
|||||||
class QcTrigger(models.Model):
|
class QcTrigger(models.Model):
|
||||||
_inherit = 'qc.trigger'
|
_inherit = 'qc.trigger'
|
||||||
|
|
||||||
picking_type = fields.Many2one(
|
picking_type_id = fields.Many2one(
|
||||||
comodel_name="stock.picking.type", readonly=True, ondelete="cascade")
|
comodel_name="stock.picking.type", readonly=True, ondelete="cascade")
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -12,21 +11,21 @@ class StockPicking(models.Model):
|
|||||||
_inherit = 'stock.picking'
|
_inherit = 'stock.picking'
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
@api.depends('qc_inspections_ids', 'qc_inspections_ids.state')
|
||||||
def _compute_count_inspections(self):
|
def _compute_count_inspections(self):
|
||||||
for picking in self:
|
for picking in self:
|
||||||
picking.created_inspections = len(picking.qc_inspections)
|
picking.created_inspections = len(picking.qc_inspections_ids)
|
||||||
picking.passed_inspections = \
|
picking.passed_inspections = \
|
||||||
len([x for x in picking.qc_inspections
|
len([x for x in picking.qc_inspections_ids
|
||||||
if x.state == 'success'])
|
if x.state == 'success'])
|
||||||
picking.failed_inspections = \
|
picking.failed_inspections = \
|
||||||
len([x for x in picking.qc_inspections
|
len([x for x in picking.qc_inspections_ids
|
||||||
if x.state == 'failed'])
|
if x.state == 'failed'])
|
||||||
picking.done_inspections = \
|
picking.done_inspections = \
|
||||||
(picking.passed_inspections + picking.failed_inspections)
|
(picking.passed_inspections + picking.failed_inspections)
|
||||||
|
|
||||||
qc_inspections = fields.One2many(
|
qc_inspections_ids = fields.One2many(
|
||||||
comodel_name='qc.inspection', inverse_name='picking', copy=False,
|
comodel_name='qc.inspection', inverse_name='picking_id', copy=False,
|
||||||
string='Inspections', help="Inspections related to this picking.")
|
string='Inspections', help="Inspections related to this picking.")
|
||||||
created_inspections = fields.Integer(
|
created_inspections = fields.Integer(
|
||||||
compute="_compute_count_inspections", string="Created inspections")
|
compute="_compute_count_inspections", string="Created inspections")
|
||||||
@@ -38,12 +37,12 @@ class StockPicking(models.Model):
|
|||||||
compute="_compute_count_inspections", string="Inspections failed")
|
compute="_compute_count_inspections", string="Inspections failed")
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def do_transfer(self):
|
def action_done(self):
|
||||||
res = super(StockPicking, self).do_transfer()
|
res = super(StockPicking, self).action_done()
|
||||||
inspection_model = self.env['qc.inspection']
|
inspection_model = self.env['qc.inspection']
|
||||||
for operation in self.pack_operation_ids:
|
for operation in self.move_lines:
|
||||||
qc_trigger = self.env['qc.trigger'].search(
|
qc_trigger = self.env['qc.trigger'].search(
|
||||||
[('picking_type', '=', self.picking_type_id.id)])
|
[('picking_type_id', '=', self.picking_type_id.id)])
|
||||||
trigger_lines = set()
|
trigger_lines = set()
|
||||||
for model in ['qc.trigger.product_category_line',
|
for model in ['qc.trigger.product_category_line',
|
||||||
'qc.trigger.product_template_line',
|
'qc.trigger.product_template_line',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -15,7 +14,7 @@ class StockPickingType(models.Model):
|
|||||||
qc_trigger = {
|
qc_trigger = {
|
||||||
'name': self.name,
|
'name': self.name,
|
||||||
'company_id': self.warehouse_id.company_id.id,
|
'company_id': self.warehouse_id.company_id.id,
|
||||||
'picking_type': self.id,
|
'picking_type_id': self.id,
|
||||||
'partner_selectable': True,
|
'partner_selectable': True,
|
||||||
}
|
}
|
||||||
return self.env['qc.trigger'].sudo().create(qc_trigger)
|
return self.env['qc.trigger'].sudo().create(qc_trigger)
|
||||||
@@ -31,7 +30,9 @@ class StockPickingType(models.Model):
|
|||||||
res = super(StockPickingType, self).write(vals)
|
res = super(StockPickingType, self).write(vals)
|
||||||
if vals.get('name') or vals.get('warehouse_id'):
|
if vals.get('name') or vals.get('warehouse_id'):
|
||||||
qc_trigger_model = self.env['qc.trigger'].sudo()
|
qc_trigger_model = self.env['qc.trigger'].sudo()
|
||||||
qc_trigger = qc_trigger_model.search(
|
for rec in self:
|
||||||
[('picking_type', '=', self.id)])
|
qc_trigger = qc_trigger_model.search(
|
||||||
qc_trigger.name = self.name
|
[('picking_type_id', '=', rec.id)])
|
||||||
|
qc_trigger.name = rec.name
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -10,19 +9,20 @@ class StockProductionLot(models.Model):
|
|||||||
_inherit = 'stock.production.lot'
|
_inherit = 'stock.production.lot'
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('qc_inspections', 'qc_inspections.state')
|
@api.depends('qc_inspections_ids', 'qc_inspections_ids.state')
|
||||||
def _compute_count_inspections(self):
|
def _compute_count_inspections(self):
|
||||||
for lot in self:
|
for lot in self:
|
||||||
lot.created_inspections = len(lot.qc_inspections)
|
lot.created_inspections = len(lot.qc_inspections_ids)
|
||||||
lot.passed_inspections = \
|
lot.passed_inspections = \
|
||||||
len([x for x in lot.qc_inspections if x.state == 'success'])
|
len([x for x in lot.qc_inspections_ids
|
||||||
|
if x.state == 'success'])
|
||||||
lot.failed_inspections = \
|
lot.failed_inspections = \
|
||||||
len([x for x in lot.qc_inspections if x.state == 'failed'])
|
len([x for x in lot.qc_inspections_ids if x.state == 'failed'])
|
||||||
lot.done_inspections = \
|
lot.done_inspections = \
|
||||||
(lot.passed_inspections + lot.failed_inspections)
|
(lot.passed_inspections + lot.failed_inspections)
|
||||||
|
|
||||||
qc_inspections = fields.One2many(
|
qc_inspections_ids = fields.One2many(
|
||||||
comodel_name='qc.inspection', inverse_name='lot', copy=False,
|
comodel_name='qc.inspection', inverse_name='lot_id', copy=False,
|
||||||
string='Inspections', help="Inspections related to this lot.")
|
string='Inspections', help="Inspections related to this lot.")
|
||||||
created_inspections = fields.Integer(
|
created_inspections = fields.Integer(
|
||||||
compute="_compute_count_inspections", string="Created inspections")
|
compute="_compute_count_inspections", string="Created inspections")
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from . import test_quality_control_stock
|
from . import test_quality_control_stock
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2015 Oihane Crucelaegui - AvanzOSC
|
# Copyright 2015 Oihane Crucelaegui - AvanzOSC
|
||||||
# Copyright 2018 Simone Rubino - Agile Business Group
|
# Copyright 2018 Simone Rubino - Agile Business Group
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
@@ -14,7 +13,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.inspection_model = self.env['qc.inspection']
|
self.inspection_model = self.env['qc.inspection']
|
||||||
self.qc_trigger_model = self.env['qc.trigger']
|
self.qc_trigger_model = self.env['qc.trigger']
|
||||||
self.picking_type_model = self.env['stock.picking.type']
|
self.picking_type_model = self.env['stock.picking.type']
|
||||||
self.product = self.env.ref('product.product_product_4')
|
self.product = self.env.ref('product.product_product_2')
|
||||||
self.partner1 = self.env.ref('base.res_partner_2')
|
self.partner1 = self.env.ref('base.res_partner_2')
|
||||||
self.partner2 = self.env.ref('base.res_partner_4')
|
self.partner2 = self.env.ref('base.res_partner_4')
|
||||||
self.test = self.env.ref('quality_control.qc_test_1')
|
self.test = self.env.ref('quality_control.qc_test_1')
|
||||||
@@ -29,7 +28,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'inspection_lines': inspection_lines,
|
'inspection_lines': inspection_lines,
|
||||||
})
|
})
|
||||||
self.trigger = self.qc_trigger_model.search(
|
self.trigger = self.qc_trigger_model.search(
|
||||||
[('picking_type', '=', self.picking_type.id)])
|
[('picking_type_id', '=', self.picking_type.id)])
|
||||||
self.lot = self.env['stock.production.lot'].create({
|
self.lot = self.env['stock.production.lot'].create({
|
||||||
'name': 'Lot for tests',
|
'name': 'Lot for tests',
|
||||||
'product_id': self.product.id,
|
'product_id': self.product.id,
|
||||||
@@ -41,6 +40,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'product_uom_qty': 2.0,
|
'product_uom_qty': 2.0,
|
||||||
'location_id': self.picking_type.default_location_src_id.id,
|
'location_id': self.picking_type.default_location_src_id.id,
|
||||||
'location_dest_id': self.location_dest.id,
|
'location_dest_id': self.location_dest.id,
|
||||||
|
'quantity_done': 1.0
|
||||||
}
|
}
|
||||||
self.picking1 = self.picking_model \
|
self.picking1 = self.picking_model \
|
||||||
.with_context(default_picking_type_id=self.picking_type.id) \
|
.with_context(default_picking_type_id=self.picking_type.id) \
|
||||||
@@ -52,15 +52,22 @@ class TestQualityControl(TransactionCase):
|
|||||||
})
|
})
|
||||||
self.picking1.action_confirm()
|
self.picking1.action_confirm()
|
||||||
self.picking1.force_assign()
|
self.picking1.force_assign()
|
||||||
self.picking1.do_prepare_partial()
|
sequence = 10
|
||||||
for line in self.picking1.pack_operation_ids.filtered(
|
for line in self.picking1.move_lines.filtered(
|
||||||
lambda r: r.product_id == self.product):
|
lambda r: r.product_id == self.product):
|
||||||
line.write({
|
line.write({
|
||||||
'pack_lot_ids': [(0, 0, {
|
'move_line_ids': [(0, 0, {
|
||||||
'lot_id': self.lot.id,
|
'lot_id': self.lot.id,
|
||||||
'qty': 2.0
|
'product_uom_qty': 1.0,
|
||||||
})]
|
'qty_done': 1.0,
|
||||||
|
'product_uom_id': line.product_uom.id,
|
||||||
|
'product_id': line.product_id.id,
|
||||||
|
'location_id': line.location_id.id,
|
||||||
|
'location_dest_id': line.location_dest_id.id,
|
||||||
|
})],
|
||||||
|
'sequence': sequence
|
||||||
})
|
})
|
||||||
|
sequence += 10
|
||||||
|
|
||||||
def test_inspection_create_for_product(self):
|
def test_inspection_create_for_product(self):
|
||||||
self.product.qc_triggers = [(
|
self.product.qc_triggers = [(
|
||||||
@@ -72,7 +79,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
inspection = self.picking1.qc_inspections[:1]
|
inspection = self.picking1.qc_inspections_ids[:1]
|
||||||
self.assertEqual(inspection.qty, 2.0)
|
self.assertEqual(inspection.qty, 2.0)
|
||||||
self.assertEqual(inspection.test, self.test,
|
self.assertEqual(inspection.test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
@@ -91,7 +98,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_inspection_create_for_category(self):
|
def test_inspection_create_for_category(self):
|
||||||
@@ -104,7 +111,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_inspection_create_for_product_partner(self):
|
def test_inspection_create_for_product_partner(self):
|
||||||
@@ -118,7 +125,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_inspection_create_for_template_partner(self):
|
def test_inspection_create_for_template_partner(self):
|
||||||
@@ -132,7 +139,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_inspection_create_for_category_partner(self):
|
def test_inspection_create_for_category_partner(self):
|
||||||
@@ -146,7 +153,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_inspection_create_for_product_wrong_partner(self):
|
def test_inspection_create_for_product_wrong_partner(self):
|
||||||
@@ -201,11 +208,11 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking1.do_transfer()
|
self.picking1.do_transfer()
|
||||||
self.assertEqual(self.picking1.created_inspections, 1,
|
self.assertEqual(self.picking1.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.picking1.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
self.assertEqual(self.lot.created_inspections, 1,
|
self.assertEqual(self.lot.created_inspections, 1,
|
||||||
'Only one inspection must be created')
|
'Only one inspection must be created')
|
||||||
self.assertEqual(self.lot.qc_inspections[:1].test, self.test,
|
self.assertEqual(self.lot.qc_inspections_ids[:1].test, self.test,
|
||||||
'Wrong test picked when creating inspection.')
|
'Wrong test picked when creating inspection.')
|
||||||
|
|
||||||
def test_picking_type(self):
|
def test_picking_type(self):
|
||||||
@@ -215,7 +222,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'sequence_id': self.sequence.id
|
'sequence_id': self.sequence.id
|
||||||
})
|
})
|
||||||
trigger = self.qc_trigger_model.search(
|
trigger = self.qc_trigger_model.search(
|
||||||
[('picking_type', '=', picking_type.id)])
|
[('picking_type_id', '=', picking_type.id)])
|
||||||
self.assertEqual(len(trigger), 1,
|
self.assertEqual(len(trigger), 1,
|
||||||
'One trigger must have been created.')
|
'One trigger must have been created.')
|
||||||
self.assertEqual(trigger.name, picking_type.name,
|
self.assertEqual(trigger.name, picking_type.name,
|
||||||
@@ -228,34 +235,37 @@ class TestQualityControl(TransactionCase):
|
|||||||
|
|
||||||
def test_qc_inspection_picking(self):
|
def test_qc_inspection_picking(self):
|
||||||
self.inspection1.write({
|
self.inspection1.write({
|
||||||
|
'name': self.picking1.move_lines[:1]._name + "inspection",
|
||||||
'object_id': '%s,%d' % (self.picking1._name,
|
'object_id': '%s,%d' % (self.picking1._name,
|
||||||
self.picking1.id),
|
self.picking1.id),
|
||||||
})
|
})
|
||||||
self.assertEquals(self.inspection1.picking,
|
self.assertEqual(self.inspection1.picking_id,
|
||||||
self.picking1)
|
self.picking1)
|
||||||
|
|
||||||
def test_qc_inspection_stock_move(self):
|
def test_qc_inspection_stock_move(self):
|
||||||
self.inspection1.write({
|
self.inspection1.write({
|
||||||
|
'name': self.picking1.move_lines[:1]._name + "inspection",
|
||||||
'object_id': '%s,%d' % (self.picking1.move_lines[:1]._name,
|
'object_id': '%s,%d' % (self.picking1.move_lines[:1]._name,
|
||||||
self.picking1.move_lines[:1].id),
|
self.picking1.move_lines[:1].id),
|
||||||
})
|
})
|
||||||
self.inspection1.onchange_object_id()
|
self.inspection1.onchange_object_id()
|
||||||
self.assertEquals(self.inspection1.picking,
|
self.assertEqual(self.inspection1.picking_id,
|
||||||
self.picking1)
|
self.picking1)
|
||||||
self.assertEquals(self.inspection1.lot,
|
self.assertEqual(self.inspection1.lot_id,
|
||||||
self.picking1.move_lines[:1].lot_ids[:1])
|
self.lot)
|
||||||
self.assertEquals(self.inspection1.product,
|
self.assertEqual(self.inspection1.product_id,
|
||||||
self.picking1.move_lines[:1].product_id)
|
self.picking1.move_lines[:1].product_id)
|
||||||
self.assertEquals(self.inspection1.qty,
|
self.assertEqual(self.inspection1.qty,
|
||||||
self.picking1.move_lines[:1].product_qty)
|
self.picking1.move_lines[:1].product_qty)
|
||||||
|
|
||||||
def test_qc_inspection_lot(self):
|
def test_qc_inspection_lot(self):
|
||||||
self.inspection1.write({
|
self.inspection1.write({
|
||||||
|
'name': self.picking1.move_lines[:1]._name + "inspection",
|
||||||
'object_id': '%s,%d' % (self.lot._name,
|
'object_id': '%s,%d' % (self.lot._name,
|
||||||
self.lot.id),
|
self.lot.id),
|
||||||
})
|
})
|
||||||
self.inspection1.onchange_object_id()
|
self.inspection1.onchange_object_id()
|
||||||
self.assertEquals(self.inspection1.lot,
|
self.assertEqual(self.inspection1.lot_id,
|
||||||
self.lot)
|
self.lot)
|
||||||
self.assertEquals(self.inspection1.product,
|
self.assertEqual(self.inspection1.product_id,
|
||||||
self.lot.product_id)
|
self.lot.product_id)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<field name="model">qc.inspection</field>
|
<field name="model">qc.inspection</field>
|
||||||
<field name="inherit_id" ref="quality_control.qc_inspection_form_view"/>
|
<field name="inherit_id" ref="quality_control.qc_inspection_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="product" position="after">
|
<field name="product_id" position="after">
|
||||||
<field name="picking"/>
|
<field name="picking_id"/>
|
||||||
<field name="lot" groups="stock.group_production_lot"/>
|
<field name="lot_id" groups="stock.group_production_lot" />
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
<field name="model">qc.inspection</field>
|
<field name="model">qc.inspection</field>
|
||||||
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view"/>
|
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="product" position="after">
|
<field name="product_id" position="after">
|
||||||
<field name="picking"/>
|
<field name="picking_id"/>
|
||||||
<field name="lot" groups="stock.group_production_lot"/>
|
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -31,18 +31,18 @@
|
|||||||
<field name="model">qc.inspection</field>
|
<field name="model">qc.inspection</field>
|
||||||
<field name="inherit_id" ref="quality_control.qc_inspection_search_view"/>
|
<field name="inherit_id" ref="quality_control.qc_inspection_search_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="product" position="after">
|
<field name="product_id" position="after">
|
||||||
<field name="picking"/>
|
<field name="picking_id"/>
|
||||||
<field name="lot" groups="stock.group_production_lot"/>
|
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||||
</field>
|
</field>
|
||||||
<group expand="0" position="inside">
|
<group expand="0" position="inside">
|
||||||
<filter string="Picking"
|
<filter string="Picking"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
context="{'group_by': 'picking'}"/>
|
context="{'group_by': 'picking_id'}"/>
|
||||||
<filter string="Lot"
|
<filter string="Lot"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
groups="stock.group_production_lot"
|
groups="stock.group_production_lot"
|
||||||
context="{'group_by': 'lot'}"/>
|
context="{'group_by': 'lot_id'}"/>
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -52,9 +52,9 @@
|
|||||||
<field name="model">qc.inspection.line</field>
|
<field name="model">qc.inspection.line</field>
|
||||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_tree_view"/>
|
<field name="inherit_id" ref="quality_control.qc_inspection_line_tree_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="product" position="after">
|
<field name="product_id" position="after">
|
||||||
<field name="picking"/>
|
<field name="picking_id"/>
|
||||||
<field name="lot"/>
|
<field name="lot_id"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -64,9 +64,9 @@
|
|||||||
<field name="model">qc.inspection.line</field>
|
<field name="model">qc.inspection.line</field>
|
||||||
<field name="inherit_id" ref="quality_control.qc_inspection_line_search_view"/>
|
<field name="inherit_id" ref="quality_control.qc_inspection_line_search_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="product" position="after">
|
<field name="product_id" position="after">
|
||||||
<field name="picking"/>
|
<field name="picking_id"/>
|
||||||
<field name="lot"/>
|
<field name="lot_id"/>
|
||||||
</field>
|
</field>
|
||||||
<group expand="0" position="inside">
|
<group expand="0" position="inside">
|
||||||
<filter string="Picking"
|
<filter string="Picking"
|
||||||
|
|||||||
@@ -6,28 +6,28 @@
|
|||||||
<field name="name">Quality inspections from picking</field>
|
<field name="name">Quality inspections from picking</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('picking', '=', active_id)]</field>
|
<field name="domain">[('picking_id', '=', active_id)]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_picking_done" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_picking_done" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspection from picking done</field>
|
<field name="name">Quality inspection from picking done</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('picking', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
<field name="domain">[('picking_id', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_picking_passed" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_picking_passed" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspection from picking passed</field>
|
<field name="name">Quality inspection from picking passed</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'success')]</field>
|
<field name="domain">[('picking_id', '=', active_id), ('state', '=', 'success')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_picking_failed" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_picking_failed" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspections from picking failed</field>
|
<field name="name">Quality inspections from picking failed</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('picking', '=', active_id), ('state', '=', 'failed')]</field>
|
<field name="domain">[('picking_id', '=', active_id), ('state', '=', 'failed')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="stock_picking_qc_view">
|
<record model="ir.ui.view" id="stock_picking_qc_view">
|
||||||
|
|||||||
@@ -6,28 +6,28 @@
|
|||||||
<field name="name">Quality inspections from lot</field>
|
<field name="name">Quality inspections from lot</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('lot', '=', active_id)]</field>
|
<field name="domain">[('lot_id', '=', active_id)]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_lot_done" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_lot_done" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspection from lot done</field>
|
<field name="name">Quality inspection from lot done</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('lot', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
<field name="domain">[('lot_id', '=', active_id), ('state', 'not in', ['draft', 'waiting'])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_lot_passed" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_lot_passed" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspection from lot passed</field>
|
<field name="name">Quality inspection from lot passed</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'success')]</field>
|
<field name="domain">[('lot_id', '=', active_id), ('state', '=', 'success')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_qc_inspection_per_lot_failed" model="ir.actions.act_window">
|
<record id="action_qc_inspection_per_lot_failed" model="ir.actions.act_window">
|
||||||
<field name="name">Quality inspections from lot failed</field>
|
<field name="name">Quality inspections from lot failed</field>
|
||||||
<field name="res_model">qc.inspection</field>
|
<field name="res_model">qc.inspection</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('lot', '=', active_id), ('state', '=', 'failed')]</field>
|
<field name="domain">[('lot_id', '=', active_id), ('state', '=', 'failed')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="stock_lot_qc_view">
|
<record model="ir.ui.view" id="stock_lot_qc_view">
|
||||||
|
|||||||
Reference in New Issue
Block a user