[IMP] Total refactorization of quality control modules with new API, README files, and new concepts. WIP of quality_control_tolerance

This commit is contained in:
Pedro M. Baeza
2014-12-10 23:35:21 +01:00
committed by Andhitia Rama
parent 559de88ff8
commit aa1049042c
9 changed files with 189 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import qc_inspection

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class QcInspection(models.Model):
_inherit = 'qc.inspection'
force_valid = fields.Boolean(
string='Force valid',
help="Mark this field if you want to override the result of the "
"inspection")
@api.multi
def action_confirm(self):
res = super(QcInspection, self).action_confirm()
for inspection in self:
if inspection.force_valid and inspection.state != 'success':
inspection.state = 'success'
return res
@api.multi
def action_approve(self):
res = super(QcInspection, self).action_approve()
for inspection in self:
if inspection.force_valid and inspection.state != 'success':
inspection.state = 'success'
return res