mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
* security modified * some demo info added * Added "partner_selectable" field, so that inspections can by made by partner * Little view fixing, field was oe_edit_only instead of label * Add partners to trigger lines * Tests added * Trigger lines with duplicated test cleaned quality_control: Propose to OCA quality_control: required changes quality_control: Fixing coveralls quality_control_stock: * added demo data * replaced unlink method by ondelete="cascade" * required changes
27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
##############################################################################
|
|
# For copyright and license notices, see __openerp__.py file in root directory
|
|
##############################################################################
|
|
from openerp import models, fields, api
|
|
|
|
|
|
class QcInspectionSetTest(models.TransientModel):
|
|
"""This wizard is used to preset 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.
|
|
"""
|
|
_name = 'qc.inspection.set.test'
|
|
|
|
test = fields.Many2one(comodel_name='qc.test', string='Test')
|
|
|
|
@api.multi
|
|
def action_create_test(self):
|
|
inspection = self.env['qc.inspection'].browse(
|
|
self.env.context['active_id'])
|
|
inspection.test = self.test
|
|
inspection.inspection_lines.unlink()
|
|
inspection.inspection_lines = inspection._prepare_inspection_lines(
|
|
self.test)
|
|
return True
|