mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control_stock: Migration to 12.0
This commit is contained in:
committed by
Enrique Martín
parent
493008b87d
commit
01442b9b87
@@ -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/11.0/quality_control_stock
|
:target: https://github.com/OCA/manufacture/tree/12.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-11-0/manufacture-11-0-quality_control_stock
|
:target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-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/11.0
|
:target: https://runbot.odoo-community.org/runbot/129/12.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
@@ -45,7 +45,7 @@ Bug Tracker
|
|||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
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.
|
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
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_stock%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_stock%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||||
|
|
||||||
Do not contact contributors directly about support or help with technical issues.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
@@ -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 José Alés <ignacio.ales@guadaltech.es>
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
@@ -80,6 +81,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/11.0/quality_control_stock>`_ project on GitHub.
|
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/12.0/quality_control_stock>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Quality control - Stock",
|
"name": "Quality control - Stock",
|
||||||
"version": "11.0.1.0.0",
|
"version": "12.0.1.0.0",
|
||||||
"category": "Quality control",
|
"category": "Quality control",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "OdooMRP team, "
|
"author": "OdooMRP team, "
|
||||||
@@ -13,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/11.0/"
|
"website": "https://github.com/OCA/manufacture/tree/12.0/"
|
||||||
"quality_control_stock",
|
"quality_control_stock",
|
||||||
"depends": [
|
"depends": [
|
||||||
"quality_control",
|
"quality_control",
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
],
|
],
|
||||||
"data": [
|
"data": [
|
||||||
"security/ir.model.access.csv",
|
"security/ir.model.access.csv",
|
||||||
"data/quality_control_stock_data.xml",
|
|
||||||
"views/qc_inspection_view.xml",
|
"views/qc_inspection_view.xml",
|
||||||
"views/stock_picking_view.xml",
|
"views/stock_picking_view.xml",
|
||||||
"views/stock_production_lot_view.xml",
|
"views/stock_production_lot_view.xml",
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright 2018 Simone Rubino - Agile Business Group
|
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
||||||
<odoo>
|
|
||||||
<data noupdate="1">
|
|
||||||
<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>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -75,12 +75,12 @@ msgid "Picking"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: quality_control_stock
|
#. module: quality_control_stock
|
||||||
#: model:res.request.link,name:quality_control_stock.req_link_stock_picking
|
#: code:addons/quality_control_stock/models/qc_inspection.py:14
|
||||||
msgid "Picking List"
|
msgid "Picking List"
|
||||||
msgstr ""
|
msgstr ""c
|
||||||
|
|
||||||
#. module: quality_control_stock
|
#. module: quality_control_stock
|
||||||
#: model:ir.model.fields,field_description:quality_control_stock.field_qc_trigger_picking_type_id
|
#: model:ir.model.fields,field_descrption:quality_control_stock.field_qc_trigger_picking_type_id
|
||||||
msgid "Picking Type"
|
msgid "Picking Type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ msgid "Quality inspections from picking failed"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: quality_control_stock
|
#. module: quality_control_stock
|
||||||
#: model:res.request.link,name:quality_control_stock.req_link_stock_move
|
#: code:addons/quality_control_stock/models/qc_inspection.py:14
|
||||||
msgid "Stock Move"
|
msgid "Stock Move"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,29 @@
|
|||||||
# 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 odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
|
from odoo.fields import first
|
||||||
|
|
||||||
|
|
||||||
class QcInspection(models.Model):
|
class QcInspection(models.Model):
|
||||||
_inherit = 'qc.inspection'
|
_inherit = 'qc.inspection'
|
||||||
|
|
||||||
|
picking_id = fields.Many2one(
|
||||||
|
comodel_name="stock.picking", compute="_compute_picking", store=True)
|
||||||
|
lot_id = fields.Many2one(
|
||||||
|
comodel_name='stock.production.lot', compute="_compute_lot",
|
||||||
|
store=True)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def object_selection_values(self):
|
||||||
|
result = super().object_selection_values()
|
||||||
|
result.extend([
|
||||||
|
('stock.picking', "Picking List"), ('stock.move', "Stock Move")])
|
||||||
|
return result
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@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_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_id = inspection.object_id.picking_id
|
inspection.picking_id = inspection.object_id.picking_id
|
||||||
@@ -24,18 +37,22 @@ class QcInspection(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('object_id')
|
@api.depends('object_id')
|
||||||
def _compute_lot(self):
|
def _compute_lot(self):
|
||||||
|
moves = self.filtered(
|
||||||
|
lambda i: i.object_id and
|
||||||
|
i.object_id._name == 'stock.move').mapped('object_id')
|
||||||
|
move_lines = self.env['stock.move.line'].search([
|
||||||
|
('lot_id', '!=', False),
|
||||||
|
('move_id', 'in', [move.id for move in moves])])
|
||||||
|
|
||||||
for inspection in self:
|
for inspection in self:
|
||||||
inspection.lot_id = False
|
|
||||||
if inspection.object_id:
|
if inspection.object_id:
|
||||||
if inspection.object_id._name == 'stock.move.line':
|
if inspection.object_id._name == 'stock.move.line':
|
||||||
inspection.lot_id = \
|
inspection.lot_id = \
|
||||||
inspection.object_id.lot_id
|
inspection.object_id.lot_id
|
||||||
elif inspection.object_id._name == 'stock.move':
|
elif inspection.object_id._name == 'stock.move':
|
||||||
inspection.lot_id = \
|
inspection.lot_id = first(move_lines.filtered(
|
||||||
self.env['stock.move.line'].search([
|
lambda line: line.move_id == inspection.object_id
|
||||||
('lot_id', '!=', False),
|
)).lot_id
|
||||||
('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_id = inspection.object_id
|
inspection.lot_id = inspection.object_id
|
||||||
|
|
||||||
@@ -72,12 +89,6 @@ class QcInspection(models.Model):
|
|||||||
res['qty'] = object_ref.product_uom_qty
|
res['qty'] = object_ref.product_uom_qty
|
||||||
return res
|
return res
|
||||||
|
|
||||||
picking_id = fields.Many2one(
|
|
||||||
comodel_name="stock.picking", compute="_compute_picking", store=True)
|
|
||||||
lot_id = fields.Many2one(
|
|
||||||
comodel_name='stock.production.lot', compute="_compute_lot",
|
|
||||||
store=True)
|
|
||||||
|
|
||||||
|
|
||||||
class QcInspectionLine(models.Model):
|
class QcInspectionLine(models.Model):
|
||||||
_inherit = 'qc.inspection.line'
|
_inherit = 'qc.inspection.line'
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ class StockPicking(models.Model):
|
|||||||
def action_done(self):
|
def action_done(self):
|
||||||
res = super(StockPicking, self).action_done()
|
res = super(StockPicking, self).action_done()
|
||||||
inspection_model = self.env['qc.inspection']
|
inspection_model = self.env['qc.inspection']
|
||||||
|
qc_trigger = self.env['qc.trigger'].search(
|
||||||
|
[('picking_type_id', '=', self.picking_type_id.id)])
|
||||||
for operation in self.move_lines:
|
for operation in self.move_lines:
|
||||||
qc_trigger = self.env['qc.trigger'].search(
|
|
||||||
[('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',
|
||||||
|
|||||||
@@ -10,20 +10,20 @@ class StockPickingType(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _create_qc_trigger(self):
|
def _create_qc_trigger(self):
|
||||||
self.ensure_one()
|
for picking_type in self:
|
||||||
qc_trigger = {
|
qc_trigger = {
|
||||||
'name': self.name,
|
'name': picking_type.name,
|
||||||
'company_id': self.warehouse_id.company_id.id,
|
'company_id': picking_type.warehouse_id.company_id.id,
|
||||||
'picking_type_id': self.id,
|
'picking_type_id': picking_type.id,
|
||||||
'partner_selectable': True,
|
'partner_selectable': True
|
||||||
}
|
}
|
||||||
return self.env['qc.trigger'].sudo().create(qc_trigger)
|
self.env['qc.trigger'].sudo().create(qc_trigger)
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, val_list):
|
||||||
picking_type = super(StockPickingType, self).create(vals)
|
picking_types = super(StockPickingType, self).create(val_list)
|
||||||
picking_type._create_qc_trigger()
|
picking_types._create_qc_trigger()
|
||||||
return picking_type
|
return picking_types
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
* 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 José Alés <ignacio.ales@guadaltech.es>
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|||||||
!! This file is generated by oca-gen-addon-readme !!
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
!! changes will be overwritten. !!
|
!! changes will be overwritten. !!
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/11.0/quality_control_stock"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-quality_control_stock"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/12.0/quality_control_stock"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-quality_control_stock"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||||
<p>This module defines triggers that creates inspections when stock moves are done.</p>
|
<p>This module defines triggers that creates inspections when stock moves are done.</p>
|
||||||
<p>It also adds some shortcuts on picking and lots to these inspections.</p>
|
<p>It also adds some shortcuts on picking and lots to these inspections.</p>
|
||||||
<p><strong>Table of contents</strong></p>
|
<p><strong>Table of contents</strong></p>
|
||||||
@@ -394,7 +394,7 @@ ul.auto-toc {
|
|||||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
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
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_stock%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_stock%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<div class="section" id="credits">
|
||||||
@@ -414,6 +414,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||||||
<li>Pedro M. Baeza <<a class="reference external" href="mailto:pedro.baeza@serviciobaeza.com">pedro.baeza@serviciobaeza.com</a>></li>
|
<li>Pedro M. Baeza <<a class="reference external" href="mailto:pedro.baeza@serviciobaeza.com">pedro.baeza@serviciobaeza.com</a>></li>
|
||||||
<li>Oihane Crucelaegui <<a class="reference external" href="mailto:oihanecrucelaegi@avanzosc.es">oihanecrucelaegi@avanzosc.es</a>></li>
|
<li>Oihane Crucelaegui <<a class="reference external" href="mailto:oihanecrucelaegi@avanzosc.es">oihanecrucelaegi@avanzosc.es</a>></li>
|
||||||
<li>Simone Rubino <<a class="reference external" href="mailto:simone.rubino@agilebg.com">simone.rubino@agilebg.com</a>></li>
|
<li>Simone Rubino <<a class="reference external" href="mailto:simone.rubino@agilebg.com">simone.rubino@agilebg.com</a>></li>
|
||||||
|
<li>Ignacio José Alés <<a class="reference external" href="mailto:ignacio.ales@guadaltech.es">ignacio.ales@guadaltech.es</a>></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="maintainers">
|
<div class="section" id="maintainers">
|
||||||
@@ -423,7 +424,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
promote its widespread use.</p>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/11.0/quality_control_stock">OCA/manufacture</a> project on GitHub.</p>
|
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/12.0/quality_control_stock">OCA/manufacture</a> project on GitHub.</p>
|
||||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ class TestQualityControl(TransactionCase):
|
|||||||
'location_dest_id': self.location_dest.id
|
'location_dest_id': self.location_dest.id
|
||||||
})
|
})
|
||||||
self.picking1.action_confirm()
|
self.picking1.action_confirm()
|
||||||
self.picking1.force_assign()
|
|
||||||
sequence = 10
|
sequence = 10
|
||||||
for line in self.picking1.move_lines.filtered(
|
for line in self.picking1.move_lines.filtered(
|
||||||
lambda r: r.product_id == self.product):
|
lambda r: r.product_id == self.product):
|
||||||
@@ -98,7 +97,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'test': self.test.id,
|
'test': self.test.id,
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1]
|
inspection = self.picking1.qc_inspections_ids[:1]
|
||||||
@@ -117,7 +116,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'test': self.test.id,
|
'test': self.test.id,
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
@@ -130,7 +129,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'test': self.test.id,
|
'test': self.test.id,
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
@@ -144,7 +143,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner1.ids)],
|
'partners': [(6, 0, self.partner1.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
@@ -158,7 +157,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner1.ids)],
|
'partners': [(6, 0, self.partner1.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
@@ -172,7 +171,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner1.ids)],
|
'partners': [(6, 0, self.partner1.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
@@ -186,7 +185,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner2.ids)],
|
'partners': [(6, 0, self.partner2.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
self.assertEqual(self.picking1.created_inspections, 0,
|
self.assertEqual(self.picking1.created_inspections, 0,
|
||||||
'No inspection must be created')
|
'No inspection must be created')
|
||||||
|
|
||||||
@@ -198,7 +197,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner2.ids)],
|
'partners': [(6, 0, self.partner2.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
self.assertEqual(self.picking1.created_inspections, 0,
|
self.assertEqual(self.picking1.created_inspections, 0,
|
||||||
'No inspection must be created')
|
'No inspection must be created')
|
||||||
|
|
||||||
@@ -210,7 +209,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'partners': [(6, 0, self.partner2.ids)],
|
'partners': [(6, 0, self.partner2.ids)],
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
self.assertEqual(self.picking1.created_inspections, 0,
|
self.assertEqual(self.picking1.created_inspections, 0,
|
||||||
'No inspection must be created')
|
'No inspection must be created')
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
'test': self.test.id,
|
'test': self.test.id,
|
||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
self.picking1.do_transfer()
|
self.picking1.action_done()
|
||||||
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_ids[:1].test, self.test,
|
self.assertEqual(self.picking1.qc_inspections_ids[:1].test, self.test,
|
||||||
|
|||||||
@@ -38,9 +38,11 @@
|
|||||||
<group expand="0" position="inside">
|
<group expand="0" position="inside">
|
||||||
<filter string="Picking"
|
<filter string="Picking"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
|
name="group_by_picking_id"
|
||||||
context="{'group_by': 'picking_id'}"/>
|
context="{'group_by': 'picking_id'}"/>
|
||||||
<filter string="Lot"
|
<filter string="Lot"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
|
name="group_by_lot_id"
|
||||||
groups="stock.group_production_lot"
|
groups="stock.group_production_lot"
|
||||||
context="{'group_by': 'lot_id'}"/>
|
context="{'group_by': 'lot_id'}"/>
|
||||||
</group>
|
</group>
|
||||||
@@ -71,10 +73,12 @@
|
|||||||
<group expand="0" position="inside">
|
<group expand="0" position="inside">
|
||||||
<filter string="Picking"
|
<filter string="Picking"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
context="{'group_by': 'picking'}"/>
|
name="group_by_picking_id"
|
||||||
|
context="{'group_by': 'picking_id'}"/>
|
||||||
<filter string="Lot"
|
<filter string="Lot"
|
||||||
domain="[]"
|
domain="[]"
|
||||||
context="{'group_by': 'lot'}"/>
|
name="group_by_lot_id"
|
||||||
|
context="{'group_by': 'lot_id'}"/>
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user