1、优化刀具拆解单

This commit is contained in:
yuxianghui
2024-09-13 17:37:20 +08:00
parent b4fef421dd
commit 722f6257ae
2 changed files with 16 additions and 18 deletions

View File

@@ -1505,29 +1505,26 @@ class FunctionalToolDismantle(models.Model):
'handle_code_id': self.handle_lot_id.id, 'handle_code_id': self.handle_lot_id.id,
'handle_product_id': self.handle_product_id.id, 'handle_product_id': self.handle_product_id.id,
'loading_task_source': '3', 'loading_task_source': '3',
'use_tool_time': fields.Datetime.now() + timedelta(hours=4),
'reason_for_applying': '刀具寿命到期' 'reason_for_applying': '刀具寿命到期'
}) })
action = self.env.ref('sf_tool_management.sf_functional_tool_assembly_form')
return { return {
'type': 'ir.actions.client', 'type': 'ir.actions.act_window',
'tag': 'display_notification', 'res_model': 'sf.functional.tool.assembly',
'params': { 'view_type': 'form',
'title': '组装单创建完成', 'view_mode': 'form',
'message': '请组装同名称的功能刀具', 'res_id': assembly_id.id,
'type': 'info', # 'target': 'new'
'links': [{
'label': '组装单',
'url': f'#action={action.id}&id={assembly_id.id}&model=sf.functional.tool.assembly',
}],
},
} }
# { # {
# 'type': 'ir.actions.act_window', # 'type': 'ir.actions.client',
# 'res_model': 'sf.functional.tool.assembly', # 'tag': 'display_notification',
# 'view_type': 'form', # 'params': {
# 'view_mode': 'form', # 'title': '组装单创建完成',
# 'res_id': assembly_id.id, # 'message': '请组装同名称的功能刀具',
# 'type': 'info'
# }
# } # }
# 'params': { # 'params': {

View File

@@ -891,7 +891,8 @@
<group attrs="{'invisible': [('dismantle_cause', 'not in', ['寿命到期报废','崩刀报废'])]}"> <group attrs="{'invisible': [('dismantle_cause', 'not in', ['寿命到期报废','崩刀报废'])]}">
<!-- <group col="3">--> <!-- <group col="3">-->
<group> <group>
<field name="scrap_boolean" string="是否报废" readonly="0"/> <field name="scrap_boolean" string="是否报废"
attrs="{'readonly': [('state' , '=', '已拆解')]}"/>
</group> </group>
<!-- <group></group>--> <!-- <group></group>-->
<!-- <group>--> <!-- <group>-->