优化了申请换刀功能的数据,
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'sf_base', 'mrp'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
#'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/wizard_view.xml',
|
||||
'views/tool_base_views.xml',
|
||||
|
||||
@@ -148,7 +148,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
:return:
|
||||
"""
|
||||
# 更新数据到机台换刀申请界面
|
||||
# todo 换刀申请条件需补充完善
|
||||
# todo 自动换刀申请条件需补充完善
|
||||
if(self.functional_tool_status == '异常'):
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([
|
||||
('CNC_machine_table', '=', self.CNC_machine_table)]).write({
|
||||
@@ -187,12 +187,10 @@ class MachineTableToolChangingApply(models.Model):
|
||||
:param vals:
|
||||
:return:
|
||||
"""
|
||||
# todo 增加设置直径的值
|
||||
# tool_changing_apply = self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
# [('CNC_machine_table', '=', vals.get('CNC_machine_table'))])
|
||||
# for i in tool_changing_apply:
|
||||
# print(i)
|
||||
# vals['functional_tool_diameter'] = self.diameter
|
||||
# 增加设置直径的值
|
||||
tool_changing_apply = self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
[('CNC_machine_table', '=', vals['machine_tool_name'])])
|
||||
vals['functional_tool_diameter'] = tool_changing_apply.diameter
|
||||
|
||||
self.env['sf.functional.tool.assembly'].create(vals)
|
||||
|
||||
@@ -342,7 +340,13 @@ class FunctionalToolAssembly(models.Model):
|
||||
receive_time = fields.Datetime(string='领用出库时间')
|
||||
remark = fields.Char(string='备注说明')
|
||||
|
||||
check_box = fields.Boolean(string='复选框', default=False, attrs="{'readonly': [('assemble_status', '!=', '1')]}")
|
||||
check_box_1 = fields.Boolean(string='复选框', default=False)
|
||||
|
||||
@api.onchange('assemble_status')
|
||||
def check_box(self):
|
||||
if self.assemble_status != '1':
|
||||
self.check_box_1 = False
|
||||
|
||||
|
||||
def cancel_functional_tool_assembly(self):
|
||||
"""
|
||||
@@ -366,7 +370,9 @@ class FunctionalToolAssembly(models.Model):
|
||||
'cut_time': None,
|
||||
'cut_length': None,
|
||||
'cut_number': None,
|
||||
'assemble_status': '0'
|
||||
'assemble_status': '0',
|
||||
'tool_loading_person':None,
|
||||
'tool_loading_time':None
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
|
||||
<button string="组装单打印" name="assemble_single_print" type="object" class="btn-primary"/>
|
||||
|
||||
<field name="check_box"/>
|
||||
<field name="check_box_1" attrs="{'readonly': [('assemble_status', '!=', '1')]}"/>
|
||||
|
||||
<field name="assemble_status"/>
|
||||
<field name="use_tool_time" />
|
||||
|
||||
@@ -43,6 +43,7 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
||||
'remark': self.new_former,
|
||||
'status': '1'
|
||||
}
|
||||
print('desc:', desc)
|
||||
# 将数据更新到机台换刀申请界面
|
||||
self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
[('CNC_machine_table', '=', desc.get('CNC_machine_table'))]).write(desc)
|
||||
@@ -92,7 +93,7 @@ class ToolTransferRequestInformation(models.TransientModel):
|
||||
|
||||
def tool_transfer_apply(self):
|
||||
"""
|
||||
刀具转移申请信息确定按钮
|
||||
todo 刀具转移申请信息确定按钮
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
@@ -245,5 +246,7 @@ class DeliveryOfCargoFromStorage(models.TransientModel):
|
||||
('functional_tool_code', '=', val.functional_tool_code),
|
||||
('functional_tool_name', '=', val.functional_tool_name)
|
||||
]).write({
|
||||
'assemble_status': '2'
|
||||
'assemble_status': '2',
|
||||
'receive_person': self.env.user.name,
|
||||
'receive_time': fields.Datetime.now()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user