Merge pull request #242 from SimoRubi/quality_control_fix

Quality control fix
This commit is contained in:
Pedro M. Baeza
2017-12-12 12:19:24 +01:00
committed by GitHub
4 changed files with 9 additions and 8 deletions

View File

@@ -8,14 +8,10 @@
{
"name": "Quality control",
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"category": "Quality control",
"license": "AGPL-3",
"author": "OdooMRP team, "
"AvanzOSC, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Eficent, "
"Agile Business Group, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture/tree/10.0/quality_control",
"depends": [

View File

@@ -7,6 +7,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, exceptions, fields, models, _
from odoo.tools import formatLang
import odoo.addons.decimal_precision as dp
@@ -249,7 +250,9 @@ class QcInspectionLine(models.Model):
self.valid_values = ", ".join([x.name for x in
self.possible_ql_values if x.ok])
else:
self.valid_values = "%s-%s" % (self.min_value, self.max_value)
self.valid_values = "%s ~ %s" % (
formatLang(self.env, self.min_value),
formatLang(self.env, self.max_value))
if self.env.ref("product.group_uom") in self.env.user.groups_id:
self.valid_values += " %s" % self.test_uom_id.name

View File

@@ -61,8 +61,8 @@ class QcTestQuestion(models.Model):
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."))
_("Question %s has no value marked as OK. "
"You have to mark at least one.") % self.name_get()[0][1])
@api.one
@api.constrains('min_value', 'max_value')

View File

@@ -86,6 +86,8 @@
groups="product.group_uom"
attrs="{'readonly': [('question_type', '=', 'qualitative')]}" />
<field name="test_uom_category" invisible="1"/>
<field name="min_value" invisible="1"/>
<field name="max_value" invisible="1"/>
<field name="valid_values" />
<field name="success" />
</tree>