Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -2,4 +2,3 @@ from . import http
|
||||
from . import models
|
||||
from . import process_status
|
||||
from . import jd_eclp
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import uuid
|
||||
import string
|
||||
import random
|
||||
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
@@ -25,4 +24,4 @@ class ResPartner(models.Model):
|
||||
return ran_str
|
||||
|
||||
sf_token = fields.Char(u'Token', default=get_token)
|
||||
sf_secret_key = fields.Char(u'密钥', default=get_secret)
|
||||
sf_secret_key = fields.Char(u'密钥', default=get_secret)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SfEquipmentSaintenanceStandards(models.Model):
|
||||
_name = 'equipment.maintenance.standards'
|
||||
_description = '设备维保标准'
|
||||
@@ -18,6 +19,7 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
m = int(partner.code[-4:]) + 1
|
||||
num = "%04d" % m
|
||||
return num
|
||||
|
||||
code = fields.Char(string='编码')
|
||||
remark = fields.Char('备注')
|
||||
maintenance_type = fields.Selection([('保养', '保养'), ("检修", "检修")], string='类型', default='保养')
|
||||
@@ -69,6 +71,7 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
# work.sequence = current_sequence
|
||||
# current_sequence += 1
|
||||
|
||||
|
||||
class SfSaintenanceStandards(models.Model):
|
||||
_name = 'maintenance.standards'
|
||||
_description = '维保项目'
|
||||
@@ -92,7 +95,3 @@ class MaintenanceStandardImage(models.Model):
|
||||
|
||||
image = fields.Binary(string='维保图片')
|
||||
standard_id = fields.Many2one('maintenance.standards', string='Standard')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
_inherit = 'maintenance.equipment.category'
|
||||
_description = '设备类别'
|
||||
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')]
|
||||
, string='类型', default='机床')
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'),
|
||||
('检测设备', '检测设备')], string='类型', default='机床')
|
||||
|
||||
|
||||
class SfMaintenanceEquipment(models.Model):
|
||||
@@ -364,7 +364,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
images_ids_names = []
|
||||
for a in self.env['maintenance.equipment.image'].search([('id', 'in', item.image_id.ids)]):
|
||||
images_ids_names.append(a.name)
|
||||
if item.machine_tool_picture != False:
|
||||
if item.machine_tool_picture:
|
||||
image = base64.b64encode(item.machine_tool_picture).decode('utf-8')
|
||||
else:
|
||||
image = False
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_name = 'sf.maintenance.logs'
|
||||
_description = '设备故障日志'
|
||||
@@ -11,16 +12,17 @@ class SfMaintenanceLogs(models.Model):
|
||||
brand = fields.Many2one('sf.machine.brand', related='maintenance_equipment_id.brand_id', string='品牌')
|
||||
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
code_location = fields.Char(string='编码位置')
|
||||
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
fault_type = fields.Selection(
|
||||
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
fault_code = fields.Char(string='故障代码')
|
||||
fault_alarm_info = fields.Char(string='故障报警信息')
|
||||
alarm_level = fields.Selection([('一级', '一级(严重)'), ('二级', '二级(中等)'), ('三级', '三级(轻微)')], string='报警级别')
|
||||
alarm_level = fields.Selection([('一级', '一级(严重)'), ('二级', '二级(中等)'), ('三级', '三级(轻微)')],
|
||||
string='报警级别')
|
||||
alarm_time = fields.Datetime(string='报警时间')
|
||||
alarm_way = fields.Selection([('文本提示报警', '文本提示报警'), ('声光报警', '声光报警'), ('图文报警', '图文报警')], string='报警方式')
|
||||
alarm_way = fields.Selection([('文本提示报警', '文本提示报警'), ('声光报警', '声光报警'), ('图文报警', '图文报警')],
|
||||
string='报警方式')
|
||||
fault_process = fields.Text(string='故障处理方法')
|
||||
operator = fields.Many2one('res.users', string='处理人')
|
||||
recovery_time = fields.Datetime(string='复原时间')
|
||||
fault_duration = fields.Float(string='故障时长')
|
||||
note = fields.Text(string='备注')
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
sf_maintenance_type = fields.Selection([('保养', '保养'), ('检修', '检修')], string='维保类别', default='保养')
|
||||
|
||||
equipment_maintenance_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准',
|
||||
domain="[('maintenance_type','=',sf_maintenance_type)]")
|
||||
domain="[('maintenance_type','=',sf_maintenance_type)]")
|
||||
|
||||
@api.onchange('sf_maintenance_type')
|
||||
def _compute_equipment_maintenance_request_id(self):
|
||||
@@ -38,8 +38,3 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
|
||||
def confirm_maintenance_done(self):
|
||||
self.write({'stage_id': 3})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,3 @@ from . import mrp_routing_workcenter
|
||||
from . import stock
|
||||
from . import res_user
|
||||
from . import production_line_base
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -67,4 +67,5 @@ class MaintenanceRequest(models.Model):
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_inherit = 'sf.maintenance.logs'
|
||||
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='maintenance_equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='maintenance_equipment_id.production_line_id', store=True)
|
||||
|
||||
@@ -12,7 +12,8 @@ class ResWorkcenter(models.Model):
|
||||
equipment_id = fields.Many2one(
|
||||
'maintenance.equipment', string="设备",
|
||||
)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='equipment_id.production_line_id', store=True)
|
||||
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
users_ids = fields.Many2many("res.users", 'users_workcenter')
|
||||
|
||||
@@ -37,7 +37,7 @@ class Sf_Mrs_Connect(http.Controller):
|
||||
download_state = request.env['sf.cnc.processing'].with_user(
|
||||
request.env.ref("base.user_admin")).download_file_tmp(
|
||||
ret['folder_name'], r)
|
||||
if download_state == False:
|
||||
if not download_state:
|
||||
res['status'] = -2
|
||||
res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_workorder.production_id.name)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
@@ -25,4 +25,3 @@
|
||||
'application': True,
|
||||
'images': ['static/description/banner.png'],
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ from odoo import api, fields, models, modules
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
style = fields.Selection([('default', 'Default'), ('left', 'Left'), ('right', 'Right'), ('middle', 'Middle')], help='Select Background Theme')
|
||||
background = fields.Selection([('image', 'Image'), ('color', 'Color')], default='color', help='Select Background Theme')
|
||||
style = fields.Selection([('default', 'Default'), ('left', 'Left'), ('right', 'Right'), ('middle', 'Middle')],
|
||||
help='Select Background Theme')
|
||||
background = fields.Selection([('image', 'Image'), ('color', 'Color')], default='color',
|
||||
help='Select Background Theme')
|
||||
background_image = fields.Many2one('login.image', string="Image", help='Select Background Image For Login Page')
|
||||
color = fields.Char(string="Color", help="Choose your Background color")
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from .import report
|
||||
from . import report
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from .import common
|
||||
from . import common
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models
|
||||
import ctypes
|
||||
from odoo import models
|
||||
|
||||
|
||||
class Common(models.Model):
|
||||
@@ -19,6 +19,3 @@ class Common(models.Model):
|
||||
tsclibrary.closeport();
|
||||
except Exception as e:
|
||||
raise UserWarning("错误警告")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user