mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] quality_control: Migration to 10.0
This commit is contained in:
committed by
Stefano Consolaro
parent
21588862de
commit
e4a8a17a4e
@@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_quality_control
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
# Copyright 2010 NaN Projectes de Programari Lliure, S.L.
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2017 Simone Rubino - Agile Business Group
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp import exceptions
|
||||
from odoo.tests.common import TransactionCase
|
||||
from odoo import exceptions
|
||||
from ..models.qc_trigger_line import\
|
||||
_filter_trigger_lines
|
||||
|
||||
@@ -80,7 +84,7 @@ class TestQualityControl(TransactionCase):
|
||||
inspection2 = self.inspection1.copy()
|
||||
inspection2.action_draft()
|
||||
inspection2.write({'test': False})
|
||||
with self.assertRaises(exceptions.Warning):
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
inspection2.action_todo()
|
||||
inspection3 = self.inspection1.copy()
|
||||
inspection3.write({
|
||||
@@ -90,7 +94,7 @@ class TestQualityControl(TransactionCase):
|
||||
for line in inspection3.inspection_lines:
|
||||
if line.question_type == 'quantitative':
|
||||
line.quantitative_value = 15.0
|
||||
with self.assertRaises(exceptions.Warning):
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
inspection3.action_confirm()
|
||||
inspection4 = self.inspection1.copy()
|
||||
inspection4.write({
|
||||
@@ -105,7 +109,7 @@ class TestQualityControl(TransactionCase):
|
||||
})
|
||||
elif line.question_type == 'qualitative':
|
||||
line.qualitative_value = self.val_ok
|
||||
with self.assertRaises(exceptions.Warning):
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
inspection4.action_confirm()
|
||||
|
||||
def test_categories(self):
|
||||
@@ -165,7 +169,7 @@ class TestQualityControl(TransactionCase):
|
||||
self.qn_question.max_value) * 0.5, 2))
|
||||
|
||||
def test_qc_inspection_not_draft_unlink(self):
|
||||
with self.assertRaises(exceptions.Warning):
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
self.inspection1.unlink()
|
||||
inspection2 = self.inspection1.copy()
|
||||
inspection2.action_cancel()
|
||||
@@ -179,12 +183,12 @@ class TestQualityControl(TransactionCase):
|
||||
inspection2.write({
|
||||
'auto_generated': True,
|
||||
})
|
||||
with self.assertRaises(exceptions.Warning):
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
inspection2.unlink()
|
||||
|
||||
def test_qc_inspection_product(self):
|
||||
self.inspection1.write({
|
||||
'object_id': '%s,%d' % (self.product._model, self.product.id),
|
||||
'object_id': '%s,%d' % (self.product._name, self.product.id),
|
||||
})
|
||||
self.assertEquals(self.inspection1.product,
|
||||
self.product)
|
||||
|
||||
Reference in New Issue
Block a user