Files
manufacture/quality_control_mrp_oca/models/qc_inspection.py
Pedro M. Baeza cc047aa8e4 [FIX] quality_control_mrp: Some problems
[IMP] quality_control_mrp: Smartbutton to inspections
2021-03-02 12:44:19 +01:00

29 lines
962 B
Python

# -*- 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'
@api.one
@api.depends('object_id')
def get_production(self):
self.production = False
if self.object_id:
if self.object_id._name == 'stock.move':
self.production = self.object_id.production_id
production = fields.Many2one(
comodel_name="mrp.production", compute="get_production", store=True)
class QcInspectionLine(models.Model):
_inherit = 'qc.inspection.line'
production = fields.Many2one(
comodel_name="mrp.production", related="inspection_id.production",
store=True, string="Production order")