quality_control: Total refactorization with new API, README files, and new concepts. * Triggers for product category * ACLs * Tolerances in questions * one2many copyable * Fix some views * Error on same tolerance * Colors on inspection lines * Unify inspection header data assignment in set_test method * key name in set_test * Change icon set

This commit is contained in:
Pedro M. Baeza
2014-12-10 23:35:21 +01:00
committed by lreficent
parent 09e27d1c1b
commit a6ede073a3
32 changed files with 2189 additions and 2281 deletions

View File

@@ -1,70 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L.
# All Rights Reserved.
# http://www.NaN-tic.com
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp.osv import orm, fields
from openerp import models, fields, api
class QcTestWizard(orm.TransientModel):
class QcInspectionSetTest(models.TransientModel):
"""This wizard is responsible for setting the test for a given
inspection. This will not only fill in the 'test' field, but will
also fill in all lines of the inspection with the corresponding lines of
the template.
"""
This wizard is responsible for setting the proof template for a given test.
This will not only fill in the 'test_template_id' field, but will also fill
in all lines of the test with the corresponding lines of the template.
"""
_name = 'qc.test.set.template.wizard'
_name = 'qc.inspection.set.test'
def _default_test_template_id(self, cr, uid, context=None):
test = self.pool['qc.test'].browse(
cr, uid, context.get('active_id', False), context=context)
cond = [('object_id', '=', test.object_id.id)]
ids = self.pool['qc.test.template'].search(cr, uid, cond,
context=context)
return ids and ids[0] or False
test = fields.Many2one(comodel_name='qc.test', string='Test')
_columns = {
'test_template_id': fields.many2one('qc.test.template', 'Template'),
}
_defaults = {
'test_template_id': _default_test_template_id,
}
def action_create_test(self, cr, uid, ids, context=None):
wizard = self.browse(cr, uid, ids[0], context=context)
self.pool['qc.test'].set_test_template(cr, uid, [context['active_id']],
wizard.test_template_id.id,
context=context)
return {
'type': 'ir.actions.act_window_close',
}
def action_cancel(self, cr, uid, ids, context=None):
return {
'type': 'ir.actions.act_window_close',
}
@api.multi
def action_create_test(self):
inspection_obj = self.env['qc.inspection']
inspection_obj.browse(self.env.context['active_id']).set_test(
self.test)
return True