diff --git a/quality_control_stock_oca/README.rst b/quality_control_stock_oca/README.rst
index a077339aa..efc0afd5d 100644
--- a/quality_control_stock_oca/README.rst
+++ b/quality_control_stock_oca/README.rst
@@ -14,13 +14,13 @@ Quality control - Stock
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
- :target: https://github.com/OCA/manufacture/tree/12.0/quality_control_stock
+ :target: https://github.com/OCA/manufacture/tree/13.0/quality_control_stock
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-quality_control_stock
+ :target: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-quality_control_stock
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/129/12.0
+ :target: https://runbot.odoo-community.org/runbot/129/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -45,7 +45,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -68,6 +68,7 @@ Contributors
* Simone Rubino
* Andrii Skrypka
* Ignacio José Alés
+* Pimolnat Suntian
Maintainers
~~~~~~~~~~~
@@ -82,6 +83,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/manufacture `_ project on GitHub.
+This module is part of the `OCA/manufacture `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/quality_control_stock_oca/__manifest__.py b/quality_control_stock_oca/__manifest__.py
index 4a7b39eac..ec8619f1a 100644
--- a/quality_control_stock_oca/__manifest__.py
+++ b/quality_control_stock_oca/__manifest__.py
@@ -10,7 +10,7 @@
"license": "AGPL-3",
"author": "OdooMRP team, AvanzOSC, Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Agile Business Group, Odoo Community Association (OCA)",
- "website": "https://github.com/OCA/manufacture/tree/12.0/quality_control_stock",
+ "website": "https://github.com/OCA/manufacture",
"depends": ["quality_control", "stock"],
"data": [
"security/ir.model.access.csv",
diff --git a/quality_control_stock_oca/models/qc_inspection.py b/quality_control_stock_oca/models/qc_inspection.py
index 8869216bc..c51606040 100644
--- a/quality_control_stock_oca/models/qc_inspection.py
+++ b/quality_control_stock_oca/models/qc_inspection.py
@@ -16,13 +16,17 @@ class QcInspection(models.Model):
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")])
+ result.extend(
+ [
+ ("stock.picking", "Picking List"),
+ ("stock.move", "Stock Move"),
+ ("stock.production.lot", "Lot/Serial Number"),
+ ]
+ )
return result
- @api.multi
@api.depends("object_id")
def _compute_picking(self):
for inspection in self:
@@ -34,7 +38,6 @@ class QcInspection(models.Model):
elif inspection.object_id._name == "stock.move.line":
inspection.picking_id = inspection.object_id.picking_id
- @api.multi
@api.depends("object_id")
def _compute_lot(self):
moves = self.filtered(
@@ -57,7 +60,6 @@ class QcInspection(models.Model):
elif inspection.object_id._name == "stock.production.lot":
inspection.lot_id = inspection.object_id
- @api.multi
@api.depends("object_id")
def _compute_product_id(self):
"""Overriden for getting the product from a stock move."""
@@ -79,11 +81,8 @@ class QcInspection(models.Model):
elif self.object_id._name == "stock.move.line":
self.qty = self.object_id.product_qty
- @api.multi
def _prepare_inspection_header(self, object_ref, trigger_line):
- res = super(QcInspection, self)._prepare_inspection_header(
- object_ref, trigger_line
- )
+ res = super()._prepare_inspection_header(object_ref, trigger_line)
# Fill qty when coming from pack operations
if object_ref and object_ref._name == "stock.move.line":
res["qty"] = object_ref.product_qty
diff --git a/quality_control_stock_oca/models/stock_picking.py b/quality_control_stock_oca/models/stock_picking.py
index 5c6eb8a24..f0455df9f 100644
--- a/quality_control_stock_oca/models/stock_picking.py
+++ b/quality_control_stock_oca/models/stock_picking.py
@@ -52,7 +52,6 @@ class StockPicking(models.Model):
picking.passed_inspections + picking.failed_inspections
)
- @api.multi
def action_done(self):
res = super(StockPicking, self).action_done()
inspection_model = self.env["qc.inspection"]
diff --git a/quality_control_stock_oca/models/stock_picking_type.py b/quality_control_stock_oca/models/stock_picking_type.py
index fc9f6b1d6..e6f48bb37 100644
--- a/quality_control_stock_oca/models/stock_picking_type.py
+++ b/quality_control_stock_oca/models/stock_picking_type.py
@@ -8,7 +8,6 @@ from odoo import api, models
class StockPickingType(models.Model):
_inherit = "stock.picking.type"
- @api.multi
def _create_qc_trigger(self):
for picking_type in self:
qc_trigger = {
@@ -25,7 +24,6 @@ class StockPickingType(models.Model):
picking_types._create_qc_trigger()
return picking_types
- @api.multi
def write(self, vals):
res = super(StockPickingType, self).write(vals)
if vals.get("name") or vals.get("warehouse_id"):
diff --git a/quality_control_stock_oca/readme/CONTRIBUTORS.rst b/quality_control_stock_oca/readme/CONTRIBUTORS.rst
index 87dc7ed76..59de90080 100644
--- a/quality_control_stock_oca/readme/CONTRIBUTORS.rst
+++ b/quality_control_stock_oca/readme/CONTRIBUTORS.rst
@@ -3,3 +3,4 @@
* Simone Rubino
* Andrii Skrypka
* Ignacio José Alés
+* Pimolnat Suntian
diff --git a/quality_control_stock_oca/static/description/index.html b/quality_control_stock_oca/static/description/index.html
index 9d8d772b1..0dc25f4a0 100644
--- a/quality_control_stock_oca/static/description/index.html
+++ b/quality_control_stock_oca/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module defines triggers that creates inspections when stock moves are done.
It also adds some shortcuts on picking and lots to these inspections.
Table of contents
@@ -394,7 +394,7 @@ ul.auto-toc {
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -425,7 +426,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/manufacture project on GitHub.
+
This module is part of the OCA/manufacture project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/quality_control_stock_oca/tests/test_quality_control_stock.py b/quality_control_stock_oca/tests/test_quality_control_stock.py
index cae4a09dd..06e1df89f 100644
--- a/quality_control_stock_oca/tests/test_quality_control_stock.py
+++ b/quality_control_stock_oca/tests/test_quality_control_stock.py
@@ -20,8 +20,10 @@ class TestQualityControl(TransactionCase):
self.test = self.env.ref("quality_control.qc_test_1")
self.picking_type = self.env.ref("stock.picking_type_out")
self.location_dest = self.env.ref("stock.stock_location_customers")
- self.sequence = self.env["ir.sequence"].search(
- [("prefix", "like", "/OUT/")], limit=1
+ self.group_stock_user = self.env.ref("stock.group_stock_user")
+ self.company = self.env.ref("base.main_company")
+ self.sequence = self.env["ir.sequence"].create(
+ {"code": "out", "name": "outgoing_sequence"}
)
inspection_lines = self.inspection_model._prepare_inspection_lines(self.test)
self.inspection1 = self.inspection_model.create(
@@ -31,12 +33,14 @@ class TestQualityControl(TransactionCase):
[("picking_type_id", "=", self.picking_type.id)]
)
self.lot = self.env["stock.production.lot"].create(
- {"name": "Lot for tests", "product_id": self.product.id}
+ {
+ "name": "Lot for tests",
+ "product_id": self.product.id,
+ "company_id": self.company.id,
+ }
)
- self.group_stock_user = self.env.ref("stock.group_stock_user")
- self.company1 = self.env.ref("base.main_company")
self.user1_id = self._create_user(
- "user_1", [self.group_stock_user], self.company1
+ "user_1", [self.group_stock_user], self.company
)
move_vals = {
@@ -49,7 +53,7 @@ class TestQualityControl(TransactionCase):
"quantity_done": 1.0,
}
self.picking1 = (
- self.picking_model.sudo(self.user1_id)
+ self.picking_model.with_user(self.user1_id)
.with_context(default_picking_type_id=self.picking_type.id)
.create(
{
@@ -296,6 +300,7 @@ class TestQualityControl(TransactionCase):
{
"name": "Test Picking Type",
"code": "outgoing",
+ "sequence_code": "OUT",
"sequence_id": self.sequence.id,
}
)