新增批量出库功能(功能已完成,按键未增加),新增自动组装方法(todo),新增出库按键弹窗样式修改
This commit is contained in:
@@ -8,7 +8,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
_description = '功能刀具管理'
|
||||
|
||||
order = fields.Char(string='序')
|
||||
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具', invisible=True)
|
||||
functional_cutting_tool_id = fields.Char(string='功能刀具', invisible=True)
|
||||
# 功能刀具预警 特有字段
|
||||
install_tool_time = fields.Char("装刀时间")
|
||||
outbound_time = fields.Char('出库时间')
|
||||
@@ -104,11 +104,11 @@ class MachineTableToolChangingApply(models.Model):
|
||||
_name = 'sf.machine.table.tool.changing.apply'
|
||||
_description = '机床换刀申请'
|
||||
|
||||
apply_to_tool_change_ids = fields.One2many(
|
||||
'sf.tool.change.requirement.information',
|
||||
'tool_change_to_apply_id',
|
||||
string='换刀需求信息',
|
||||
attrs="{'invisible': 1}")
|
||||
# apply_to_tool_change_ids = fields.One2many(
|
||||
# 'sf.tool.change.requirement.information',
|
||||
# 'tool_change_to_apply_id',
|
||||
# string='换刀需求信息',
|
||||
# attrs="{'invisible': 1}")
|
||||
|
||||
CNC_machine_table = fields.Char(string='CNC机床')
|
||||
# todo 机床类型和刀位号 为 Many2one
|
||||
@@ -260,7 +260,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
|
||||
def automation_apply_for_tooling(self):
|
||||
"""
|
||||
todo 自动申请装刀
|
||||
自动申请装刀
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.functional.tool.assembly'].create({
|
||||
@@ -303,6 +303,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
class FunctionalToolAssembly(models.Model):
|
||||
_name = 'sf.functional.tool.assembly'
|
||||
_description = '功能刀具组装'
|
||||
_order = 'use_tool_time asc'
|
||||
|
||||
functional_tool_code = fields.Char(string='功能刀具编码')
|
||||
functional_tool_name = fields.Char(string='功能刀具名称')
|
||||
@@ -317,7 +318,6 @@ class FunctionalToolAssembly(models.Model):
|
||||
knife_handle_name = fields.Char(string='刀柄名称')
|
||||
knife_handle_brand = fields.Char(string='品牌')
|
||||
knife_handle_type = fields.Char(string='型号')
|
||||
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精')
|
||||
tool_loading_length = fields.Char(string='装刀长')
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧')
|
||||
@@ -330,7 +330,6 @@ class FunctionalToolAssembly(models.Model):
|
||||
applicant = fields.Char(string='申请人')
|
||||
reason_for_applying = fields.Char(string='申请原因')
|
||||
apply_time = fields.Datetime(string='申请时间', default=fields.Datetime.now())
|
||||
|
||||
assemble_status = fields.Selection([('0', '待组装'), ('1', '已组装'), ('2', '已出库')],string='组装状态', default='0')
|
||||
use_tool_time = fields.Datetime(string='用刀时间')
|
||||
production_line_name = fields.Char(string='产线名称')
|
||||
@@ -343,6 +342,8 @@ 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')]}")
|
||||
|
||||
def cancel_functional_tool_assembly(self):
|
||||
"""
|
||||
取消功能刀具组装
|
||||
@@ -367,3 +368,62 @@ class FunctionalToolAssembly(models.Model):
|
||||
'cut_number': None,
|
||||
'assemble_status': '0'
|
||||
})
|
||||
|
||||
|
||||
def show_popup(self):
|
||||
"""
|
||||
单个功能刀具出库
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.delivery.of.cargo.from.storage'].search([]).unlink()
|
||||
|
||||
vals = self.env['sf.functional.tool.assembly'].search([('check_box', '=', True),('assemble_status', '=', '1')])
|
||||
|
||||
if vals:
|
||||
for val in vals:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': val.functional_tool_code,
|
||||
'functional_tool_name': val.functional_tool_name,
|
||||
'functional_tool_type': val.functional_tool_type,
|
||||
'production_line_name': val.production_line_name,
|
||||
'machine_tool_code': val.machine_tool_code,
|
||||
'receive_person': val.receive_person,
|
||||
'receive_time': val.receive_time
|
||||
})
|
||||
else:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'functional_tool_name': self.functional_tool_name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'production_line_name': self.production_line_name,
|
||||
'machine_tool_code': self.machine_tool_code,
|
||||
'receive_person': self.receive_person,
|
||||
'receive_time': self.receive_time
|
||||
})
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': '功能刀具出库',
|
||||
'res_model': 'sf.delivery.of.cargo.from.storage',
|
||||
'view_mode': 'tree',
|
||||
'view_type': 'tree',
|
||||
'target': 'new'
|
||||
}
|
||||
|
||||
def automated_assembly(self):
|
||||
"""
|
||||
todo 自动组装
|
||||
:return:
|
||||
"""
|
||||
|
||||
def automatic_printing_of_QR_code(self):
|
||||
"""
|
||||
todo 自动打印二维码
|
||||
:return:
|
||||
"""
|
||||
|
||||
def assemble_single_print(self):
|
||||
"""
|
||||
todo 组装单打印
|
||||
:return:
|
||||
"""
|
||||
Reference in New Issue
Block a user