mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[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:
committed by
Andhitia Rama
parent
559de88ff8
commit
aa1049042c
6
quality_control_force_valid/models/__init__.py
Normal file
6
quality_control_force_valid/models/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import qc_inspection
|
||||
31
quality_control_force_valid/models/qc_inspection.py
Normal file
31
quality_control_force_valid/models/qc_inspection.py
Normal 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
|
||||
Reference in New Issue
Block a user