mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control_stock_oca: Migration to 14.0
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Quality control - Stock (OCA)",
|
"name": "Quality control - Stock (OCA)",
|
||||||
"version": "13.0.1.0.1",
|
"version": "14.0.1.0.0",
|
||||||
"category": "Quality control",
|
"category": "Quality control",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "OdooMRP team, AvanzOSC, Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
"author": "OdooMRP team, AvanzOSC, Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class StockPicking(models.Model):
|
|||||||
picking.passed_inspections + picking.failed_inspections
|
picking.passed_inspections + picking.failed_inspections
|
||||||
)
|
)
|
||||||
|
|
||||||
def action_done(self):
|
def _action_done(self):
|
||||||
res = super().action_done()
|
res = super()._action_done()
|
||||||
inspection_model = self.env["qc.inspection"]
|
inspection_model = self.env["qc.inspection"]
|
||||||
qc_trigger = self.env["qc.trigger"].search(
|
qc_trigger = self.env["qc.trigger"].search(
|
||||||
[("picking_type_id", "=", self.picking_type_id.id)]
|
[("picking_type_id", "=", self.picking_type_id.id)]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_user_qc_inspection_stock_user,qc_inspection stock user,quality_control_oca.model_qc_inspection,stock.group_stock_user,1,1,1,0
|
access_stock_user_qc_inspection,qc_inspection stock_user,quality_control_oca.model_qc_inspection,stock.group_stock_user,1,1,1,0
|
||||||
access_user_qc_inspection_line_stock_user,qc_inspection_line stock user,quality_control_oca.model_qc_inspection_line,stock.group_stock_user,1,1,1,0
|
access_stock_user_qc_inspection_line,qc_inspection_line stock_user,quality_control_oca.model_qc_inspection_line,stock.group_stock_user,1,1,1,0
|
||||||
access_user_qc_test_stock_user,qc_test stock_user,quality_control_oca.model_qc_test,stock.group_stock_user,1,0,0,0
|
access_stock_user_qc_test,qc_test stock_user,quality_control_oca.model_qc_test,stock.group_stock_user,1,0,0,0
|
||||||
access_user_qc_test_question_stock_user,qc_test_question stock user,quality_control_oca.model_qc_test_question,stock.group_stock_user,1,0,0,0
|
access_stock_user_qc_test_question,qc_test_question stock_user,quality_control_oca.model_qc_test_question,stock.group_stock_user,1,0,0,0
|
||||||
access_user_qc_test_question_value_stock_user,qc_test_question_value_stock_user,quality_control_oca.model_qc_test_question_value,stock.group_stock_user,1,0,0,0
|
access_stock_user_qc_test_question_value,qc_test_question_value stock_user,quality_control_oca.model_qc_test_question_value,stock.group_stock_user,1,0,0,0
|
||||||
access_manager_qc_trigger_stock_user,qc_trigger stock user,quality_control_oca.model_qc_trigger,stock.group_stock_user,1,0,0,0
|
access_stock_user_qc_trigger,qc_trigger stock user,quality_control_oca.model_qc_trigger,stock.group_stock_user,1,0,0,0
|
||||||
access_manager_qc_trigger_product_category_line_stock_user,qc_trigger product_category line stock user,quality_control_oca.model_qc_trigger_product_category_line,stock.group_stock_user,1,0,0,0
|
access_stock_user_qc_trigger_product_category_line,qc_trigger_product_category_line stock_user,quality_control_oca.model_qc_trigger_product_category_line,stock.group_stock_user,1,0,0,0
|
||||||
|
|||||||
|
@@ -20,6 +20,9 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.picking_type = self.env.ref("stock.picking_type_out")
|
self.picking_type = self.env.ref("stock.picking_type_out")
|
||||||
self.location_dest = self.env.ref("stock.stock_location_customers")
|
self.location_dest = self.env.ref("stock.stock_location_customers")
|
||||||
self.group_stock_user = self.env.ref("stock.group_stock_user")
|
self.group_stock_user = self.env.ref("stock.group_stock_user")
|
||||||
|
self.group_quality_control_user = self.env.ref(
|
||||||
|
"quality_control_oca.group_quality_control_user"
|
||||||
|
)
|
||||||
self.company = self.env.ref("base.main_company")
|
self.company = self.env.ref("base.main_company")
|
||||||
self.sequence = self.env["ir.sequence"].create(
|
self.sequence = self.env["ir.sequence"].create(
|
||||||
{"code": "out", "name": "outgoing_sequence"}
|
{"code": "out", "name": "outgoing_sequence"}
|
||||||
@@ -39,7 +42,9 @@ class TestQualityControl(TransactionCase):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.user1_id = self._create_user(
|
self.user1_id = self._create_user(
|
||||||
"user_1", [self.group_stock_user], self.company
|
"user_1",
|
||||||
|
[self.group_stock_user, self.group_quality_control_user],
|
||||||
|
self.company,
|
||||||
)
|
)
|
||||||
move_vals = {
|
move_vals = {
|
||||||
"name": self.product.name,
|
"name": self.product.name,
|
||||||
@@ -109,7 +114,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.product.qc_triggers = [
|
self.product.qc_triggers = [
|
||||||
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -127,7 +132,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.product.product_tmpl_id.qc_triggers = [
|
self.product.product_tmpl_id.qc_triggers = [
|
||||||
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -141,7 +146,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.product.categ_id.qc_triggers = [
|
self.product.categ_id.qc_triggers = [
|
||||||
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -163,7 +168,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -185,7 +190,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -207,7 +212,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -229,7 +234,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 0, "No inspection must be created"
|
self.picking1.created_inspections, 0, "No inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -246,7 +251,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 0, "No inspection must be created"
|
self.picking1.created_inspections, 0, "No inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -263,7 +268,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 0, "No inspection must be created"
|
self.picking1.created_inspections, 0, "No inspection must be created"
|
||||||
)
|
)
|
||||||
@@ -275,7 +280,7 @@ class TestQualityControl(TransactionCase):
|
|||||||
self.product.categ_id.qc_triggers = [
|
self.product.categ_id.qc_triggers = [
|
||||||
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
(0, 0, {"trigger": self.trigger.id, "test": self.test.id})
|
||||||
]
|
]
|
||||||
self.picking1.action_done()
|
self.picking1.button_validate()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
self.picking1.created_inspections, 1, "Only one inspection must be created"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user