优化了工作日历时间输入,新增工作日历设置自动计算时长功能,修改了生产线模型的位置(移至sf_maintenance模块下),优化了部分的产线设备资源设置模型
This commit is contained in:
@@ -3,17 +3,36 @@ from odoo import models, fields
|
||||
|
||||
class ProcedureEquipmentResourceSetting(models.Model):
|
||||
_name = 'sf.procedure.equipment.resource.setting'
|
||||
_description = '工序设备资源设置'
|
||||
_description = '产线设备资源设置'
|
||||
|
||||
name = fields.Char(string='设备名称')
|
||||
machine_tool_name = fields.Char(string='机台号')
|
||||
def _get_code(self):
|
||||
"""
|
||||
自动生成编码
|
||||
:return:
|
||||
"""
|
||||
fixture_material = self.env['sf.procedure.equipment.resource.setting'].sudo().search(
|
||||
[('code', '!=', '')],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not fixture_material:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(fixture_material.code) + 1
|
||||
num = "%03d" % m
|
||||
return num
|
||||
|
||||
code = fields.Char(string='序号', readonly=True, default=_get_code)
|
||||
work_center_name = fields.Char(string='工作中心名称')
|
||||
equipment_code = fields.Char(string='机台号')
|
||||
# todo 绑定设备
|
||||
# equipment_name = fields.Many2one('', string='设备名称')
|
||||
brand = fields.Char(string='品牌')
|
||||
model = fields.Char(string='型号')
|
||||
production_capacity = fields.Char(string='产能')
|
||||
working_calendar = fields.Many2one('sf.work.log.setting', string='工作日历')
|
||||
working_procedure = fields.Char(string='工序')
|
||||
production_capacity = fields.Char(string='产能', required=True)
|
||||
working_calendar_id = fields.Many2one('sf.work.log.setting', string='工作日历')
|
||||
working_shift = fields.Char(string='班次')
|
||||
create_time = fields.Datetime(string='新增时间', default=lambda self: fields.Datetime.now())
|
||||
stale_dated_time = fields.Datetime(string='过期时间')
|
||||
status = fields.Selection([('0', '正常'), ('1', '故障停机'), ('2', '计划停机')], string='设备状态', default='0')
|
||||
participate_in_scheduling = fields.Boolean(string='参与排程', default=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user