diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss
index d8e2ab85..12e18c1c 100644
--- a/jikimo_frontend/static/src/scss/custom_style.scss
+++ b/jikimo_frontend/static/src/scss/custom_style.scss
@@ -79,9 +79,9 @@ td.o_required_modifier {
}
.oe_kanban_card.kanban_color_1 {
- background-color: #27FEA9 !important;
+ background-color: #fff !important;
opacity: 0.7;
- color: #fff;
+ color: #777;
}
.oe_kanban_card.kanban_color_3 {
diff --git a/sf_machine_connect/views/machine_monitor.xml b/sf_machine_connect/views/machine_monitor.xml
index 9c9a21a3..d52bead8 100644
--- a/sf_machine_connect/views/machine_monitor.xml
+++ b/sf_machine_connect/views/machine_monitor.xml
@@ -10,7 +10,7 @@
-
+
@@ -143,7 +143,7 @@
-
+
-->
diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py
index acb87eb6..73826ed9 100644
--- a/sf_maintenance/models/sf_maintenance.py
+++ b/sf_maintenance/models/sf_maintenance.py
@@ -17,12 +17,30 @@ class SfMaintenanceEquipmentCategory(models.Model):
equipment_type_code = fields.Char('简写')
+class SfMaintenanceEquipmentAGVLog(models.Model):
+ _name = 'maintenance.equipment.agv.log'
+ _description = 'AGV运行日志'
+
+ run_type = fields.Char('任务类型')
+ run_code = fields.Char('任务指令代码')
+ run_first = fields.Char('任务起点')
+ production_line = fields.Char('目的生产线')
+ run_last = fields.Char('任务终点')
+ workorder = fields.Char('工件编码/任务单号')
+ time = fields.Datetime('日期/事件')
+ state = fields.Char('事件/状体')
+ equipment_id = fields.Many2one('maintenance.equipment', '设备')
+
+
class SfMaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
_description = '设备'
crea_url = "/api/machine_tool/create"
+
+ #AGV运行日志
+ agv_logs = fields.One2many('maintenance.equipment.agv.log', 'equipment_id', string='AGV运行日志')
# 1212修改后的字段
number_of_axles = fields.Selection(
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴"), ("六轴", "六轴")],
@@ -194,6 +212,7 @@ class SfMaintenanceEquipment(models.Model):
# 多个型号对应一个机床
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_id', '设备故障日志')
+ equipment_oee_ids = fields.One2many('maintenance.equipment.oee', 'equipment_id', '设备OEE')
# def name_get(self):
# result = []
diff --git a/sf_maintenance/models/sf_maintenance_oee.py b/sf_maintenance/models/sf_maintenance_oee.py
index 71802fda..6d76ffbe 100644
--- a/sf_maintenance/models/sf_maintenance_oee.py
+++ b/sf_maintenance/models/sf_maintenance_oee.py
@@ -23,6 +23,7 @@ class SfMaintenanceEquipmentOEE(models.Model):
fault_nums = fields.Integer('故障次数')
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_oee_id', '设备故障日志',
related='equipment_id.sf_maintenance_logs_ids')
+ oee_logs = fields.One2many('maintenance.equipment.oee.logs', 'equipment_oee_id', string='运行日志')
def name_get(self):
result = []
@@ -30,4 +31,19 @@ class SfMaintenanceEquipmentOEE(models.Model):
if parameter.equipment_id:
name = parameter.equipment_id.name
result.append((parameter.id, name))
- return result
\ No newline at end of file
+ return result
+
+
+class SfMaintenanceEquipmentOEELog(models.Model):
+ _name = 'maintenance.equipment.oee.logs'
+ _description = '设备运行日志'
+
+ name = fields.Char('运行日志')
+ run_time = fields.Datetime('时间')
+ state = fields.Selection([("开机", "开机"), ("关机", "关机"), ("等待", "等待"), ("开始加工", "开始加工"),
+ ("结束加工", "结束加工"), ("故障", "故障"),
+ ("检修", "检修"), ("保养", "保养")], default="", string="事件/状态")
+ workorder_id = fields.Char('加工订单')
+ time = fields.Char('持续时长')
+ color = fields.Char('颜色', default=1)
+ equipment_oee_id = fields.Many2one('maintenance.equipment.oee', '设备OEE')
diff --git a/sf_maintenance/security/ir.model.access.csv b/sf_maintenance/security/ir.model.access.csv
index 0853ee77..076c4e76 100644
--- a/sf_maintenance/security/ir.model.access.csv
+++ b/sf_maintenance/security/ir.model.access.csv
@@ -7,12 +7,18 @@ access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,s
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_user,1,0,0,0
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_manager,1,1,1,0
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,base.group_user,1,1,1,1
+access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,sf_group_equipment_user,1,0,0,0
+access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,sf_group_equipment_manager,1,1,1,0
+access_maintenance_equipment_oee_logs,maintenance_equipment_oee_logs,model_maintenance_equipment_oee_logs,base.group_user,1,1,1,1
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,0,0,0
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_manager,1,1,1,0
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,0,0,0
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_manager,1,1,1,0
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,0,0,0
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_manager,1,1,1,0
+access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,sf_group_equipment_user,1,0,0,0
+access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,sf_group_equipment_manager,1,1,1,0
+access_maintenance_equipment_agv_log,maintenance_equipment_agv_log,model_maintenance_equipment_agv_log,base.group_user,1,1,1,1
access_maintenance_system_user,equipment.request system user,maintenance.model_maintenance_request,base.group_user,1,0,0,0
diff --git a/sf_maintenance/views/maintenance_equipment_oee_views.xml b/sf_maintenance/views/maintenance_equipment_oee_views.xml
index 60055631..091e3c47 100644
--- a/sf_maintenance/views/maintenance_equipment_oee_views.xml
+++ b/sf_maintenance/views/maintenance_equipment_oee_views.xml
@@ -49,6 +49,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -63,6 +76,7 @@
+
diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml
index 0dc18355..125a86c0 100644
--- a/sf_maintenance/views/maintenance_views.xml
+++ b/sf_maintenance/views/maintenance_views.xml
@@ -32,6 +32,14 @@
+
@@ -63,15 +71,18 @@
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
-
+
-
-
@@ -115,22 +126,26 @@
-
-
-
-
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -913,28 +944,30 @@
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py
index df9437ba..1ca9affa 100644
--- a/sf_mrs_connect/models/sync_common.py
+++ b/sf_mrs_connect/models/sync_common.py
@@ -314,12 +314,12 @@ class sfProductionProcess(models.Model):
brand = self.env['sf.production.process'].search(
[("code", '=', item['code'])])
if brand:
- brand.name = item['name'],
+ brand.name = item['name']
brand.category_id = self.env['sf.production.process.category'].search(
- [("code", '=', item['category_code'])]).id,
- brand.code = item['code'],
- brand.remark = item['remark'],
- brand.active = item['active'],
+ [("code", '=', item['category_code'])]).id
+ brand.code = item['code']
+ brand.remark = item['remark']
+ brand.active = item['active']
brand.remark = item['remark']
production_process = self.search([("code", '=', item['code'])])
category = self.env['sf.production.process.category'].search(
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index ae06d91b..b55d7003 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -15,6 +15,7 @@ class FunctionalCuttingToolEntity(models.Model):
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', related='functional_tool_name_id.tool_groups_id')
code = fields.Char('编码', related='functional_tool_name_id.code')
+ rfid = fields.Char('rfid', readonly=True)
name = fields.Char(related='functional_tool_name_id.name')
functional_tool_name_id = fields.Many2one('sf.functional.tool.assembly', string='功能刀具名称', readonly=True)
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
@@ -211,6 +212,7 @@ class FunctionalToolWarning(models.Model):
_description = '功能刀具预警'
code = fields.Char('编码', related='functional_tool_name_id.code')
+ rfid = fields.Char('rfid', related='functional_tool_name_id.rfid')
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', related='functional_tool_name_id.tool_groups_id')
name = fields.Char('名称', invisible=True, readonly=True, related='functional_tool_name_id.name')
# 机床信息
@@ -281,6 +283,7 @@ class StockMoveLine(models.Model):
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)', related='functional_tool_name_id.knife_tip_r_angle')
install_tool_time = fields.Datetime("刀具组装时间", related='functional_tool_name_id.tool_loading_time')
code = fields.Char('编码', related='functional_tool_name_id.code')
+ rfid = fields.Char('rfid', related='functional_tool_name_id.rfid')
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', related='functional_tool_name_id.tool_groups_id')
@api.model
@@ -476,6 +479,7 @@ class MachineTableToolChangingApply(models.Model):
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', store=True,
domain=[('product_id.name', '=', '功能刀具')],
related='functional_tool_name_id.barcode_id')
+ rfid = fields.Char('rfid', related='functional_tool_name_id.rfid')
functional_tool_name_id = fields.Many2one('sf.functional.tool.assembly', domain=[('assemble_status', '=', '1')],
string='功能刀具名称')
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', store=True,
@@ -502,7 +506,7 @@ class MachineTableToolChangingApply(models.Model):
reason_for_applying = fields.Char(string='申请原因', readonly=True)
remark = fields.Char(string='备注说明', readonly=False)
- status = fields.Selection([('0', '未操作'), ('1', '已换刀申请'), ('2', '已转移'), ('3', '已组装')],
+ status = fields.Selection([('0', '未操作'), ('1', '已申请换刀'), ('2', '已转移'), ('3', '已组装')],
string='操作状态', default='0')
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装单', readonly=True)
@@ -787,6 +791,7 @@ class FunctionalToolAssembly(models.Model):
obj.name = obj.after_assembly_functional_tool_name
code = fields.Char('功能刀具编码', readonly=True)
+ rfid = fields.Char('rfid', readonly=True)
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', readonly=True)
name = fields.Char(string='名称', readonly=True, compute='_compute_name')
assembly_order_code = fields.Char(string='组装单编码', readonly=True)
diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml
index 9cbbeeeb..59229492 100644
--- a/sf_tool_management/views/tool_base_views.xml
+++ b/sf_tool_management/views/tool_base_views.xml
@@ -7,7 +7,8 @@
sf.functional.cutting.tool.entity
-
+
+
@@ -76,12 +77,13 @@
-
+
-
+
+
@@ -178,6 +180,7 @@
+
@@ -224,7 +227,8 @@
-
+
+
@@ -250,6 +254,7 @@
+
@@ -376,7 +381,7 @@
-
+
@@ -435,7 +440,8 @@
-
+
+
@@ -457,6 +463,7 @@
+
@@ -510,6 +517,7 @@
+
@@ -529,6 +537,7 @@
'default_machine_tool_code': machine_tool_code,
'default_cutter_spacing_code_id': cutter_spacing_code_id,
'default_barcode_id': barcode_id,
+ 'default_rfid': rfid,
'default_functional_tool_name': functional_tool_name,
'default_functional_tool_type_id': functional_tool_type_id,
'default_tool_position_interface_type': tool_position_interface_type,
@@ -551,7 +560,7 @@
'default_replacement_extension_length': extension_length,
'default_replacement_effective_length': effective_length,
}"
- attrs="{'invisible': [('status', '!=', '0')]}"
+ attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
class="btn-primary" groups="sf_base.group_sf_mrp_user"
/>
+ attrs="{'invisible': [('status', '!=', '1')]}" groups="sf_base.group_sf_mrp_user"
+ confirm="是否确认撤回换刀申请"/>
+ attrs="{'invisible': [('status', '!=', '2')]}" groups="sf_base.group_sf_mrp_user"
+ confirm="是否确认撤回转移"/>
@@ -607,6 +619,7 @@
'default_machine_tool_code': machine_tool_code,
'default_cutter_spacing_code_id': cutter_spacing_code_id,
'default_barcode_id': barcode_id,
+ 'default_rfid': rfid,
'default_functional_tool_name': functional_tool_name,
'default_functional_tool_type_id': functional_tool_type_id,
'default_tool_position_interface_type': tool_position_interface_type,
@@ -629,7 +642,7 @@
'default_replacement_extension_length': extension_length,
'default_replacement_effective_length': effective_length,
}"
- attrs="{'invisible': [('status', '!=', '0')]}"
+ attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
class="btn-primary" groups="sf_base.group_sf_mrp_user"
/>
-
+
+
@@ -686,7 +703,8 @@
-
+
+
@@ -722,6 +740,7 @@
+
@@ -948,7 +967,8 @@
}"
attrs="{'invisible': [('assemble_status', '!=', '0')]}" groups="sf_base.group_sf_mrp_user"
class="btn-primary"/>
-
@@ -986,10 +1006,12 @@
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
class="btn-primary"/>
-
-
@@ -1021,7 +1043,8 @@
-
+
+
diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py
index 9f1a1aae..e6f39655 100644
--- a/sf_tool_management/wizard/wizard.py
+++ b/sf_tool_management/wizard/wizard.py
@@ -9,6 +9,7 @@ class ToolChangeRequirementInformation(models.TransientModel):
_description = '换刀需求信息'
code = fields.Char('编码', readonly=True)
+ rfid = fields.Char('rfid', readonly=True)
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', readonly=True)
name = fields.Char('名称', related='maintenance_equipment_id.name', store=True, readonly=True)
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='CNC机床', readonly=True)
@@ -321,6 +322,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
# 组装功能刀具参数信息
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号')
+ rfid = fields.Char('rfid', required=True)
tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_tool_code')
after_assembly_functional_tool_name = fields.Char(string='组装后功能刀具名称', compute='_compute_name')
after_assembly_functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model',
@@ -522,6 +524,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
return {
'barcode_id': stock_lot.id,
'code': self.tool_code,
+ 'rfid': self.rfid,
'tool_groups_id': self.tool_groups_id.id,
'integral_code_id': self.integral_code_id.id,
'blade_code_id': self.blade_code_id.id,
@@ -558,6 +561,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
return {
'barcode_id': stock_lot.id,
'code': self.tool_code,
+ 'rfid': self.rfid,
'tool_groups_id': self.tool_groups_id.id,
'functional_tool_name_id': functional_tool_assembly_id.id,
'sf_cutting_tool_type_id': self.after_assembly_functional_tool_type_id.id,
diff --git a/sf_tool_management/wizard/wizard_view.xml b/sf_tool_management/wizard/wizard_view.xml
index 5c007bdc..cd15a91b 100644
--- a/sf_tool_management/wizard/wizard_view.xml
+++ b/sf_tool_management/wizard/wizard_view.xml
@@ -24,7 +24,8 @@
-
+
+
@@ -334,6 +335,7 @@
+
diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py
index 374fb07d..e244dbd6 100644
--- a/sf_warehouse/models/model.py
+++ b/sf_warehouse/models/model.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+import datetime
import logging
from odoo import api, fields, models, _
from odoo.osv import expression
@@ -224,6 +225,23 @@ class ShelfLocation(models.Model):
_description = '货架货位'
_order = 'name'
+ # current_location_id = fields.Many2one('sf.shelf.location', string='当前位置')
+ # # 目的位置
+ # destination_location_id = fields.Many2one('sf.shelf.location', string='目的位置')
+ current_move_ids = fields.One2many('stock.move.line', 'current_location_id', '当前位置调拨单')
+ destination_move_ids = fields.One2many('stock.move.line', 'destination_location_id', '目标位置调拨单')
+ storage_time = fields.Datetime('入库时间', compute='_compute_location_status')
+
+ @api.depends('location_status')
+ def _compute_location_status(self):
+ for record in self:
+ if record.location_status == '占用':
+ record.storage_time = datetime.datetime.now()
+ if record.location_status == '空闲':
+ record.storage_time = False
+ if record.location_status == '禁用':
+ record.storage_time = False
+
name = fields.Char('名称', required=True, size=20)
barcode = fields.Char('编码', copy=False, size=15)
@@ -291,8 +309,8 @@ class ShelfLocation(models.Model):
record.sudo().product_id = record.product_sn_id.product_id
record.sudo().location_status = '占用'
else:
- record.sudo().product_id = False
- record.sudo().location_status = '空闲'
+ record.product_id = False
+ # record.location_status = '空闲'
@api.depends('location_type')
def _compute_hide_what(self):
@@ -453,7 +471,7 @@ class SfStockPicking(models.Model):
if line:
if line.current_location_id:
line.current_location_id.product_sn_id = False
- line.current_location_id = False
+ line.current_location_id.location_status = '空闲'
return res
diff --git a/sf_warehouse/static/src/css/kanban_color_change.scss b/sf_warehouse/static/src/css/kanban_color_change.scss
index aeb75150..c532bf96 100644
--- a/sf_warehouse/static/src/css/kanban_color_change.scss
+++ b/sf_warehouse/static/src/css/kanban_color_change.scss
@@ -52,7 +52,7 @@
}
.green {
- background-color: #fff !important;
+ background-color: #27FEA9 !important;
border: 1px solid #ccc;
}
diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml
index d9aa7223..b10eaaa9 100644
--- a/sf_warehouse/views/change_stock_move_views.xml
+++ b/sf_warehouse/views/change_stock_move_views.xml
@@ -7,7 +7,7 @@
-
+
+ sf.stock.move.line.tree
+ stock.move.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
sf.stock.move.line.form
stock.move.line
-
+
diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml
index 7ac4dcbc..f19a6421 100644
--- a/sf_warehouse/views/shelf_location.xml
+++ b/sf_warehouse/views/shelf_location.xml
@@ -9,26 +9,82 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ sf.view.picking.form
+ stock.move.line
+
+
+
+
+
+
+
+
+
+
+ 移动历史
+ stock.move.line
+ ir.actions.act_window
+ tree,form
+
+
+
+
+ 产品移动历史
+
+
+
+
Shelf Location form
sf.shelf.location