新增零件名称,零件图号
This commit is contained in:
@@ -152,6 +152,34 @@ class QualityCheck(models.Model):
|
|||||||
is_lot_tested_fractionally = fields.Boolean(related='point_id.is_lot_tested_fractionally')
|
is_lot_tested_fractionally = fields.Boolean(related='point_id.is_lot_tested_fractionally')
|
||||||
testing_percentage_within_lot = fields.Float(related="point_id.testing_percentage_within_lot")
|
testing_percentage_within_lot = fields.Float(related="point_id.testing_percentage_within_lot")
|
||||||
product_tracking = fields.Selection(related='product_id.tracking')
|
product_tracking = fields.Selection(related='product_id.tracking')
|
||||||
|
quality_check_type = fields.Selection([
|
||||||
|
('采购入库检', '采购入库检'),
|
||||||
|
('客供料入库检', '客供料入库检'),
|
||||||
|
('退货入库检', '退货入库检'),
|
||||||
|
('生产入库检', '生产入库检'),
|
||||||
|
('外协入库检', '外协入库检'),
|
||||||
|
('成品发货检', '成品发货检'),
|
||||||
|
('工序外协发货检', '工序外协发货检'),
|
||||||
|
('委外坯料发货检', '委外坯料发货检')], string='类型', compute='_compute_quality_check_type', store=True)
|
||||||
|
|
||||||
|
@api.depends('picking_id')
|
||||||
|
def _compute_quality_check_type(self):
|
||||||
|
for check in self:
|
||||||
|
if check.picking_id:
|
||||||
|
picking_type = check.picking_id.picking_type_id.sequence_code
|
||||||
|
type_mapping = {
|
||||||
|
'IN': '采购入库检',
|
||||||
|
'DL': '客供料入库检',
|
||||||
|
'RET': '退货入库检',
|
||||||
|
'SFP': '生产入库检',
|
||||||
|
'OCIN': '外协入库检',
|
||||||
|
'OUT': '成品发货检',
|
||||||
|
'OCOUT': '工序外协发货检',
|
||||||
|
'RES': '委外坯料发货检',
|
||||||
|
}
|
||||||
|
check.quality_check_type = type_mapping.get(picking_type, False)
|
||||||
|
else:
|
||||||
|
check.quality_check_type = False
|
||||||
|
|
||||||
@api.depends('measure_success')
|
@api.depends('measure_success')
|
||||||
def _compute_warning_message(self):
|
def _compute_warning_message(self):
|
||||||
@@ -294,6 +322,19 @@ class QualityAlert(models.Model):
|
|||||||
_inherit = "quality.alert"
|
_inherit = "quality.alert"
|
||||||
|
|
||||||
title = fields.Char('Title')
|
title = fields.Char('Title')
|
||||||
|
part_number = fields.Char(string='零件图号', compute='_compute_part_info', store=True)
|
||||||
|
part_name = fields.Char(string='零件名称', compute='_compute_part_info', store=True)
|
||||||
|
|
||||||
|
@api.depends('product_id', 'picking_id')
|
||||||
|
def _compute_part_info(self):
|
||||||
|
for alert in self:
|
||||||
|
if alert.product_tmpl_id.categ_id.name == '成品':
|
||||||
|
alert.part_number = alert.product_id.part_number
|
||||||
|
alert.part_name = alert.product_id.part_name
|
||||||
|
elif alert.product_id.categ_id.name == '坯料':
|
||||||
|
if alert.picking_id.move_ids_without_package:
|
||||||
|
alert.part_number = alert.picking_id.move_ids_without_package[0].part_number
|
||||||
|
alert.part_name = alert.picking_id.move_ids_without_package[0].part_name
|
||||||
|
|
||||||
def action_see_check(self):
|
def action_see_check(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -90,6 +90,8 @@
|
|||||||
<field name="lot_id" context="{'default_product_id': product_id}"
|
<field name="lot_id" context="{'default_product_id': product_id}"
|
||||||
groups="stock.group_production_lot"/>
|
groups="stock.group_production_lot"/>
|
||||||
<field name="picking_id"/>
|
<field name="picking_id"/>
|
||||||
|
<field name="part_name"/>
|
||||||
|
<field name="part_number"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="team_id"/>
|
<field name="team_id"/>
|
||||||
@@ -150,6 +152,10 @@
|
|||||||
<field name="date_assign" position="after">
|
<field name="date_assign" position="after">
|
||||||
<field name="company_id" groups="base.main_company"/>
|
<field name="company_id" groups="base.main_company"/>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="product_tmpl_id" position="after">
|
||||||
|
<field name="part_name" optional="show"/>
|
||||||
|
<field name="part_number" optional="show"/>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -446,6 +452,10 @@
|
|||||||
<filter string="Control Point" name="groupby_point_id" context="{'group_by': 'point_id'}"/>
|
<filter string="Control Point" name="groupby_point_id" context="{'group_by': 'point_id'}"/>
|
||||||
<filter string="Team" name="groupby_team_id" context="{'group_by': 'team_id'}"/>
|
<filter string="Team" name="groupby_team_id" context="{'group_by': 'team_id'}"/>
|
||||||
</group>
|
</group>
|
||||||
|
<searchpanel>
|
||||||
|
<field name="quality_check_type" icon="fa-filter" enable_counters="1"/>
|
||||||
|
<field name="quality_state" icon="fa-filter" enable_counters="1"/>
|
||||||
|
</searchpanel>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user