Merge branch 'feature/工单-质检优化' into feature/工单-质检优化_1
This commit is contained in:
@@ -140,7 +140,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="quality_control.quality_check_action_main" model="ir.actions.act_window">
|
|
||||||
<field name="context">{'search_default_quality_checks': 1}</field>
|
|
||||||
</record>
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -1726,7 +1726,12 @@ class sf_detection_result(models.Model):
|
|||||||
processing_panel = fields.Char('加工面')
|
processing_panel = fields.Char('加工面')
|
||||||
routing_type = fields.Selection([
|
routing_type = fields.Selection([
|
||||||
('装夹预调', '装夹预调'),
|
('装夹预调', '装夹预调'),
|
||||||
('CNC加工', 'CNC加工')], string="工序类型")
|
('CNC加工', 'CNC加工'),
|
||||||
|
('解除装夹', '解除装夹'),
|
||||||
|
('切割', '切割'),
|
||||||
|
('表面工艺', '表面工艺'),
|
||||||
|
('线切割', '线切割'),
|
||||||
|
('人工线下加工', '人工线下加工')], string="工序类型")
|
||||||
|
|
||||||
rework_reason = fields.Selection(
|
rework_reason = fields.Selection(
|
||||||
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"),
|
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"),
|
||||||
|
|||||||
@@ -1267,7 +1267,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
record.production_id.process_state = '待加工'
|
record.production_id.process_state = '待加工'
|
||||||
# 生成工件配送单
|
# 生成工件配送单
|
||||||
record.workpiece_delivery_ids = record._json_workpiece_delivery_list()
|
record.workpiece_delivery_ids = record._json_workpiece_delivery_list()
|
||||||
if record.routing_type == 'CNC加工':
|
if record.routing_type == 'CNC加工' or record.individuation_page_PTD is True:
|
||||||
record.process_state = '待解除装夹'
|
record.process_state = '待解除装夹'
|
||||||
# record.write({'process_state': '待加工'})
|
# record.write({'process_state': '待加工'})
|
||||||
record.production_id.process_state = '待解除装夹'
|
record.production_id.process_state = '待解除装夹'
|
||||||
@@ -1358,17 +1358,18 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# record.production_id.state = 'done'
|
# record.production_id.state = 'done'
|
||||||
|
|
||||||
# ============工单完成,修改对应[质检单]的值=====================
|
# ============工单完成,修改对应[质检单]的值=====================
|
||||||
if record.check_ids:
|
if record.check_ids.filtered(lambda qc: qc.quality_state in ('waiting', 'none')):
|
||||||
|
check_ids = record.check_ids.filtered(lambda qc: qc.quality_state in ('waiting', 'none'))
|
||||||
if record.test_results == '合格':
|
if record.test_results == '合格':
|
||||||
record.check_ids.write({'test_results': None})
|
check_ids.write({'test_results': None})
|
||||||
for check_id in record.check_ids:
|
for check_id in check_ids:
|
||||||
check_id.do_pass()
|
check_id.do_pass()
|
||||||
elif record.test_results in ('返工', '报废'):
|
elif record.test_results in ('返工', '报废'):
|
||||||
record.check_ids.write({
|
check_ids.write({
|
||||||
'test_results': record.test_results,
|
'test_results': record.test_results,
|
||||||
'reason': record.reason,
|
'reason': record.reason,
|
||||||
'detailed_reason': record.detailed_reason})
|
'detailed_reason': record.detailed_reason})
|
||||||
for check_id in record.check_ids:
|
for check_id in check_ids:
|
||||||
check_id.do_fail()
|
check_id.do_fail()
|
||||||
# ======================================================
|
# ======================================================
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
||||||
<button name="do_inspect" type="object" string="送检" class="btn-success" confirm="是否确认送检"
|
<button name="do_inspect" type="object" string="送检" class="btn-success" confirm="是否确认送检"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('progress')), ('is_inspect', '=', False), ('routing_type','=','CNC加工')]}"/>
|
attrs="{'invisible': ['|', '|', ('state', 'not in', ('progress')), ('is_inspect', '=', False), ('routing_type','=','CNC加工')]}"/>
|
||||||
|
|
||||||
<!-- <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工" -->
|
<!-- <button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工" -->
|
||||||
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
<!-- context="{'default_workcenter_id': workcenter_id}" class="btn-danger" -->
|
||||||
@@ -529,7 +529,8 @@
|
|||||||
<page string="后置三元检测" attrs='{"invisible": [("individuation_page_PTD", "=", False)]}'>
|
<page string="后置三元检测" attrs='{"invisible": [("individuation_page_PTD", "=", False)]}'>
|
||||||
<group>
|
<group>
|
||||||
<field name="test_results"
|
<field name="test_results"
|
||||||
attrs='{"readonly":[("state","!=","to be detected")],"invisible":[("results","!=",False)]}'/>
|
attrs='{"readonly":[("state","!=","to be detected"), "|",("routing_type","=","CNC加工"),("is_inspect", "=", True)],
|
||||||
|
"invisible":[("results","!=",False)]}'/>
|
||||||
<!-- <field name="is_remanufacture" attrs='{"invisible":[("test_results","!=","报废")]}'/>-->
|
<!-- <field name="is_remanufacture" attrs='{"invisible":[("test_results","!=","报废")]}'/>-->
|
||||||
<!-- <field name="is_fetchcnc"-->
|
<!-- <field name="is_fetchcnc"-->
|
||||||
<!-- attrs='{"invisible":["|",("test_results","=","合格"),("is_remanufacture","=",False)]}'/>-->
|
<!-- attrs='{"invisible":["|",("test_results","=","合格"),("is_remanufacture","=",False)]}'/>-->
|
||||||
|
|||||||
@@ -24,7 +24,12 @@ class ReworkWizard(models.TransientModel):
|
|||||||
detailed_reason = fields.Text('详细原因')
|
detailed_reason = fields.Text('详细原因')
|
||||||
routing_type = fields.Selection([
|
routing_type = fields.Selection([
|
||||||
('装夹预调', '装夹预调'),
|
('装夹预调', '装夹预调'),
|
||||||
('CNC加工', 'CNC加工')], string="工序类型")
|
('CNC加工', 'CNC加工'),
|
||||||
|
('解除装夹', '解除装夹'),
|
||||||
|
('切割', '切割'),
|
||||||
|
('表面工艺', '表面工艺'),
|
||||||
|
('线切割', '线切割'),
|
||||||
|
('人工线下加工', '人工线下加工')], string="工序类型")
|
||||||
# 根据工单的加工面来显示
|
# 根据工单的加工面来显示
|
||||||
processing_panel_id = fields.Many2many('sf.processing.panel', string="加工面")
|
processing_panel_id = fields.Many2many('sf.processing.panel', string="加工面")
|
||||||
is_reprogramming = fields.Boolean(string='申请重新编程', default=False)
|
is_reprogramming = fields.Boolean(string='申请重新编程', default=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user