mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
quality_control: * Changed permissions
* security modified * some demo info added * Added "partner_selectable" field, so that inspections can by made by partner * Little view fixing, field was oe_edit_only instead of label * Add partners to trigger lines * Tests added * Trigger lines with duplicated test cleaned quality_control: Propose to OCA quality_control: required changes quality_control: Fixing coveralls quality_control_stock: * added demo data * replaced unlink method by ondelete="cascade" * required changes
This commit is contained in:
@@ -6,7 +6,8 @@ from openerp import models, fields, api, exceptions, _
|
||||
|
||||
|
||||
class QcTest(models.Model):
|
||||
"""A test is a group of questions to with the values that make them valid.
|
||||
"""
|
||||
A test is a group of questions along with the values that make them valid.
|
||||
"""
|
||||
_name = 'qc.test'
|
||||
_description = 'Quality control test'
|
||||
@@ -47,21 +48,16 @@ class QcTestQuestion(models.Model):
|
||||
@api.one
|
||||
@api.constrains('ql_values')
|
||||
def _check_valid_answers(self):
|
||||
if self.type == 'quantitative':
|
||||
return
|
||||
for value in self.ql_values:
|
||||
if value.ok:
|
||||
return
|
||||
raise exceptions.Warning(
|
||||
_("There isn't any value with OK marked. You have to mark at "
|
||||
"least one."))
|
||||
if (self.type == 'qualitative' and self.ql_values and
|
||||
not self.ql_values.filtered('ok')):
|
||||
raise exceptions.Warning(
|
||||
_("There isn't no value marked as OK. You have to mark at "
|
||||
"least one."))
|
||||
|
||||
@api.one
|
||||
@api.constrains('min_value', 'max_value')
|
||||
def _check_valid_range(self):
|
||||
if self.type == 'qualitative':
|
||||
return
|
||||
if self.min_value > self.max_value:
|
||||
if self.type == 'quantitative' and self.min_value > self.max_value:
|
||||
raise exceptions.Warning(
|
||||
_("Minimum value can't be higher than maximum value."))
|
||||
|
||||
@@ -84,7 +80,7 @@ class QcTestQuestion(models.Model):
|
||||
|
||||
class QcTestQuestionValue(models.Model):
|
||||
_name = 'qc.test.question.value'
|
||||
_description = 'Possible values of qualitative questions.'
|
||||
_description = 'Possible values for qualitative questions.'
|
||||
|
||||
test_line = fields.Many2one(
|
||||
comodel_name="qc.test.question", string="Test question")
|
||||
|
||||
Reference in New Issue
Block a user