diff --git a/sf_base/models/base.py b/sf_base/models/base.py
index 36a39f49..a2565d6d 100644
--- a/sf_base/models/base.py
+++ b/sf_base/models/base.py
@@ -92,7 +92,7 @@ class MachineTool(models.Model):
type_id = fields.Many2one('sf.machine_tool.type', '型号')
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
state = fields.Selection(
- [("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
+ [("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
default='正常', string="机床状态")
# 0606新增字段
machine_tool_picture = fields.Binary('图片')
diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py
index aa9a7dcb..97deb883 100644
--- a/sf_maintenance/models/sf_maintenance.py
+++ b/sf_maintenance/models/sf_maintenance.py
@@ -160,8 +160,9 @@ class SfMaintenanceEquipment(models.Model):
type_id = fields.Many2one('sf.machine_tool.type', '型号')
state = fields.Selection(
- [("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
+ [("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
default='正常', string="机床状态")
+ run_time = fields.Char('总运行时长')
# 0606新增字段
machine_tool_picture = fields.Binary('图片')
heightened_way = fields.Selection([
diff --git a/sf_maintenance/models/sf_maintenance_logs.py b/sf_maintenance/models/sf_maintenance_logs.py
index 5c798754..791f66f8 100644
--- a/sf_maintenance/models/sf_maintenance_logs.py
+++ b/sf_maintenance/models/sf_maintenance_logs.py
@@ -26,3 +26,4 @@ class SfMaintenanceLogs(models.Model):
recovery_time = fields.Datetime(string='复原时间')
fault_duration = fields.Float(string='故障时长')
note = fields.Text(string='备注')
+ active = fields.Boolean('Active', default=True)
diff --git a/sf_maintenance/views/maintenance_logs_views.xml b/sf_maintenance/views/maintenance_logs_views.xml
index a4e8d605..b0d6af79 100644
--- a/sf_maintenance/views/maintenance_logs_views.xml
+++ b/sf_maintenance/views/maintenance_logs_views.xml
@@ -105,9 +105,10 @@
- 设备故障日志
+ 设备故障日志
ir.actions.act_window
sf.maintenance.logs
+
tree,form
@@ -117,6 +118,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml
index 4735cb29..5266bced 100644
--- a/sf_maintenance/views/maintenance_views.xml
+++ b/sf_maintenance/views/maintenance_views.xml
@@ -27,7 +27,7 @@
@@ -56,6 +56,7 @@
domain="[('brand_id', '=', brand_id)]"/>
+
-->
-
-
-
+
+
+
+
+
diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py
index d728f569..bb6fd591 100644
--- a/sf_mrs_connect/controllers/controllers.py
+++ b/sf_mrs_connect/controllers/controllers.py
@@ -26,7 +26,8 @@ class Sf_Mrs_Connect(http.Controller):
cnc_production = request.env['mrp.production'].with_user(
request.env.ref("base.user_admin")).search([('name', '=', ret['production_order_no'])])
if cnc_production:
- cnc_production.glb_file = base64.b64encode(ret['glb_file'])
+ if ret['glb_file']:
+ cnc_production.glb_file = base64.b64encode(ret['glb_file'])
# 拉取所有加工面的程序文件
# i = 1
for r in ret['processing_panel']:
@@ -35,7 +36,7 @@ class Sf_Mrs_Connect(http.Controller):
ret['folder_name'], r)
if not download_state:
res['status'] = -2
- res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.production_id.name)
+ res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.name)
return json.JSONEncoder().encode(res)
request.env['sf.cnc.processing'].with_user(
request.env.ref("base.user_admin")).cnc_processing_create(cnc_production, ret)
diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py
index 1b29c6d2..09ea3f0f 100644
--- a/sf_sale/models/auto_quatotion_common.py
+++ b/sf_sale/models/auto_quatotion_common.py
@@ -2,7 +2,7 @@
import logging
from odoo.modules import get_resource_path
from odoo import fields, models, api
-#from quatotion import readSql, feature_recognize, auto_quatotion
+from quatotion import readSql, feature_recognize, auto_quatotion
__author__ = 'jinling.yang'
_logger = logging.getLogger(__name__)
diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py
index 5ec1fd52..1e5f274c 100644
--- a/sf_sale/models/quick_easy_order.py
+++ b/sf_sale/models/quick_easy_order.py
@@ -5,8 +5,8 @@ import os
import json
from datetime import datetime
import requests
-#from OCC.Extend.DataExchange import read_step_file
-#from OCC.Extend.DataExchange import write_stl_file
+from OCC.Extend.DataExchange import read_step_file
+from OCC.Extend.DataExchange import write_stl_file
from odoo import models, fields, api
from odoo.modules import get_resource_path
from odoo.exceptions import ValidationError, UserError