mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
quality_control: decimal precision configurable
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Quality control",
|
"name": "Quality control",
|
||||||
"version": "8.0.1.1.0",
|
"version": "8.0.1.2.0",
|
||||||
"category": "Quality control",
|
"category": "Quality control",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "OdooMRP team, "
|
"author": "OdooMRP team, "
|
||||||
|
|||||||
@@ -8,6 +8,11 @@
|
|||||||
<record id="qc_test_template_category_referenced" model="qc.test.category">
|
<record id="qc_test_template_category_referenced" model="qc.test.category">
|
||||||
<field name="name">Referenced</field>
|
<field name="name">Referenced</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record forcecreate="True" id="decimal_quality_control" model="decimal.precision">
|
||||||
|
<field name="name">Quality Control</field>
|
||||||
|
<field name="digits">5</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# For copyright and license notices, see __openerp__.py file in root directory
|
# For copyright and license notices, see __openerp__.py file in root directory
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from openerp import models, fields, api, exceptions, _
|
from openerp import models, fields, api, exceptions, _
|
||||||
|
import openerp.addons.decimal_precision as dp
|
||||||
|
|
||||||
|
|
||||||
class QcInspection(models.Model):
|
class QcInspection(models.Model):
|
||||||
@@ -260,7 +261,7 @@ class QcInspectionLine(models.Model):
|
|||||||
possible_ql_values = fields.Many2many(
|
possible_ql_values = fields.Many2many(
|
||||||
comodel_name='qc.test.question.value', string='Answers')
|
comodel_name='qc.test.question.value', string='Answers')
|
||||||
quantitative_value = fields.Float(
|
quantitative_value = fields.Float(
|
||||||
'Quantitative value', digits=(16, 5),
|
'Quantitative value', digits=dp.get_precision('Quality Control'),
|
||||||
help="Value of the result for a quantitative question.")
|
help="Value of the result for a quantitative question.")
|
||||||
qualitative_value = fields.Many2one(
|
qualitative_value = fields.Many2one(
|
||||||
comodel_name='qc.test.question.value', string='Qualitative value',
|
comodel_name='qc.test.question.value', string='Qualitative value',
|
||||||
@@ -268,11 +269,11 @@ class QcInspectionLine(models.Model):
|
|||||||
domain="[('id', 'in', possible_ql_values[0][2])]")
|
domain="[('id', 'in', possible_ql_values[0][2])]")
|
||||||
notes = fields.Text(string='Notes')
|
notes = fields.Text(string='Notes')
|
||||||
min_value = fields.Float(
|
min_value = fields.Float(
|
||||||
string='Min', digits=(16, 5), readonly=True,
|
string='Min', digits=dp.get_precision('Quality Control'),
|
||||||
help="Minimum valid value for a quantitative question.")
|
readonly=True, help="Minimum valid value for a quantitative question.")
|
||||||
max_value = fields.Float(
|
max_value = fields.Float(
|
||||||
string='Max', digits=(16, 5), readonly=True,
|
string='Max', digits=dp.get_precision('Quality Control'),
|
||||||
help="Maximum valid value for a quantitative question.")
|
readonly=True, help="Maximum valid value for a quantitative question.")
|
||||||
test_uom_id = fields.Many2one(
|
test_uom_id = fields.Many2one(
|
||||||
comodel_name='product.uom', string='Test UoM', readonly=True,
|
comodel_name='product.uom', string='Test UoM', readonly=True,
|
||||||
help="UoM for minimum and maximum values for a quantitative "
|
help="UoM for minimum and maximum values for a quantitative "
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# For copyright and license notices, see __openerp__.py file in root directory
|
# For copyright and license notices, see __openerp__.py file in root directory
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from openerp import models, fields, api, exceptions, _
|
from openerp import models, fields, api, exceptions, _
|
||||||
|
import openerp.addons.decimal_precision as dp
|
||||||
|
|
||||||
|
|
||||||
class QcTest(models.Model):
|
class QcTest(models.Model):
|
||||||
@@ -73,8 +74,10 @@ class QcTestQuestion(models.Model):
|
|||||||
comodel_name='qc.test.question.value', inverse_name="test_line",
|
comodel_name='qc.test.question.value', inverse_name="test_line",
|
||||||
string='Qualitative values', copy=True)
|
string='Qualitative values', copy=True)
|
||||||
notes = fields.Text(string='Notes')
|
notes = fields.Text(string='Notes')
|
||||||
min_value = fields.Float(string='Min', digits=(16, 5))
|
min_value = fields.Float(string='Min',
|
||||||
max_value = fields.Float(string='Max', digits=(15, 5))
|
digits=dp.get_precision('Quality Control'))
|
||||||
|
max_value = fields.Float(string='Max',
|
||||||
|
digits=dp.get_precision('Quality Control'),)
|
||||||
uom_id = fields.Many2one(comodel_name='product.uom', string='Uom')
|
uom_id = fields.Many2one(comodel_name='product.uom', string='Uom')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user