质量检测添加零件图号与零件名称
This commit is contained in:
@@ -7,6 +7,7 @@ from datetime import datetime
|
||||
import random
|
||||
|
||||
from odoo import api, models, fields, _
|
||||
from odoo.api import depends
|
||||
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_round
|
||||
from odoo.osv.expression import OR
|
||||
|
||||
@@ -122,7 +123,13 @@ class QualityPoint(models.Model):
|
||||
|
||||
class QualityCheck(models.Model):
|
||||
_inherit = "quality.check"
|
||||
|
||||
part_name = fields.Char('零件名称', compute='_compute_part_name_number', readonly=True)
|
||||
part_number = fields.Char('零件图号', compute='_compute_part_name_number', readonly=True)
|
||||
@depends('product_id')
|
||||
def _compute_part_name_number(self):
|
||||
for record in self:
|
||||
record.part_number = record.product_id.part_number
|
||||
record.part_name = record.product_id.part_name
|
||||
failure_message = fields.Html(related='point_id.failure_message', readonly=True)
|
||||
measure = fields.Float('Measure', default=0.0, digits='Quality Tests', tracking=True)
|
||||
measure_success = fields.Selection([
|
||||
|
||||
@@ -389,6 +389,8 @@
|
||||
<field name="name" decoration-bf="1"/>
|
||||
<field name="measure_on" optional="show"/>
|
||||
<field name='product_id' optional="show"/>
|
||||
<field name="part_name" optional="hide"/>
|
||||
<field name='part_number' optional="show"/>
|
||||
<field name="lot_id" invisible="context.get('show_lots_text')"/>
|
||||
<field name="lot_name" invisible="not context.get('show_lots_text')"/>
|
||||
<field name="picking_id" optional="hide" string="Transfer"/>
|
||||
|
||||
@@ -16,7 +16,7 @@ class SfQualityCncTest(models.Model):
|
||||
equipment_id = fields.Many2one(related='workorder_id.equipment_id', string='加工设备')
|
||||
production_line_id = fields.Many2one(related='workorder_id.production_line_id',
|
||||
string='生产线')
|
||||
part_number = fields.Char(related='workorder_id.part_number', string='成品零件图号')
|
||||
part_number = fields.Char(related='workorder_id.part_number', string='零件图号')
|
||||
detection_report = fields.Binary(related='workorder_id.detection_report', readonly=True, string='检测报告')
|
||||
state = fields.Selection([
|
||||
('waiting', '待判定'),
|
||||
|
||||
Reference in New Issue
Block a user