master-sf1.0
This commit is contained in:
2
sf_base/__init__.py
Normal file
2
sf_base/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import commons
|
||||
29
sf_base/__manifest__.py
Normal file
29
sf_base/__manifest__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫智能工厂 基础配置',
|
||||
'version': '1.0',
|
||||
'summary': '智能工厂基础模块',
|
||||
'sequence': 1,
|
||||
'description': """
|
||||
在本模块,定义了主要的角色、菜单、基础业务对象
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/base_view.xml',
|
||||
'views/common_view.xml',
|
||||
"views/menu_view.xml"
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
1
sf_base/commons/__init__.py
Normal file
1
sf_base/commons/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from. import common
|
||||
28
sf_base/commons/common.py
Normal file
28
sf_base/commons/common.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import fields, models, api
|
||||
import time
|
||||
import hashlib
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Common(models.Model):
|
||||
_name = 'sf.sync.common'
|
||||
_description = u'公用类'
|
||||
|
||||
|
||||
|
||||
def get_headers(self,token, secret_key):
|
||||
'''
|
||||
获取requests中的heardes参数
|
||||
'''
|
||||
timestamp = int(time.time())
|
||||
check_str = '%s%s%s' % (token, timestamp, secret_key)
|
||||
check_sf_str = hashlib.sha1(check_str.encode('utf-8')).hexdigest()
|
||||
headers = {'TOKEN': token,
|
||||
'TIMESTAMP': str(timestamp),
|
||||
'checkstr': check_sf_str}
|
||||
return headers
|
||||
|
||||
|
||||
4
sf_base/models/__init__.py
Normal file
4
sf_base/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import base
|
||||
from . import common
|
||||
|
||||
|
||||
264
sf_base/models/base.py
Normal file
264
sf_base/models/base.py
Normal file
@@ -0,0 +1,264 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
import json
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.http import request
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MachineBrandTags(models.Model):
|
||||
_name = 'sf.machine.brand.tags'
|
||||
_description = '标签'
|
||||
name = fields.Char('名称', size=50)
|
||||
color = fields.Integer('颜色', default=0)
|
||||
|
||||
|
||||
class MachineControlSystem(models.Model):
|
||||
_name = 'sf.machine.control_system'
|
||||
_description = '控制系统'
|
||||
|
||||
code = fields.Char('编码', size=10)
|
||||
name = fields.Char('名称', size=10)
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 品牌标签
|
||||
class MachineBrand(models.Model):
|
||||
_name = 'sf.machine.brand'
|
||||
_description = '品牌'
|
||||
|
||||
name = fields.Char('名称')
|
||||
tag_ids = fields.Many2many('sf.machine.brand.tags', 'rel_machine_brand_tags', string='类别')
|
||||
image_brand = fields.Image("品牌图片")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
|
||||
# 机床
|
||||
class MachineTool(models.Model):
|
||||
_name = 'sf.machine_tool'
|
||||
_description = '机床'
|
||||
|
||||
def get_no(self):
|
||||
partner = self.env['sf.machine_tool'].sudo().search(
|
||||
[('MTcode', '!=', '')],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not partner:
|
||||
num = "%04d" % 1
|
||||
|
||||
else:
|
||||
m = int(partner.MTcode) + 1
|
||||
num = "%04d" % m
|
||||
return num
|
||||
|
||||
MTcode = fields.Char("编码", default=get_no)
|
||||
code = fields.Char('行业编码')
|
||||
name = fields.Char('名称')
|
||||
knife_type = fields.Selection(
|
||||
[("BT40", "BT40"), ("BT30", "BT30")],
|
||||
default="", string="刀把类型")
|
||||
number_of_knife_library = fields.Integer('刀库数量')
|
||||
rotate_speed = fields.Integer('转速')
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
||||
default="", string="轴数")
|
||||
# 加工进程
|
||||
x_axis = fields.Integer('X轴')
|
||||
y_axis = fields.Integer('Y轴')
|
||||
z_axis = fields.Integer('Z轴')
|
||||
b_axis = fields.Integer('B轴')
|
||||
c_axis = fields.Integer('C轴')
|
||||
remark = fields.Text('备注')
|
||||
is_binding = fields.Boolean('是否绑定机床', default=False)
|
||||
precision = fields.Float('加工精度')
|
||||
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||
string="控制系统")
|
||||
# 多个机床型号对应一个机床
|
||||
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||
state = fields.Selection(
|
||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||
default='正常', string="机床状态")
|
||||
|
||||
# 一个机床对应一個加工工厂,一个加工工厂对应多个机床
|
||||
factory_id = fields.Many2one('res.partner', string='所属工厂',
|
||||
domain="[('is_factory', '=', True)]")
|
||||
# 一个机床对应一个供应商,一个供应商对应多个机床
|
||||
supplier_id = fields.Many2one('res.partner', string='制造商',
|
||||
domain="[('is_vendor', '=', True)]")
|
||||
registration_date = fields.Date('注册日期')
|
||||
state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册', tracking=True)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.constrains('rotate_speed')
|
||||
def _check_rotate_speed(self):
|
||||
if self.rotate_speed <= 0:
|
||||
raise ValidationError("转速不能为0")
|
||||
|
||||
@api.constrains('precision')
|
||||
def _check_precision(self):
|
||||
if self.precision <= 0.00:
|
||||
raise ValidationError("加工精度不能为0")
|
||||
|
||||
@api.constrains('number_of_knife_library')
|
||||
def _check_number_of_knife_library(self):
|
||||
if self.number_of_knife_library <= 0:
|
||||
raise ValidationError("刀库数量不能为0")
|
||||
|
||||
@api.constrains('x_axis')
|
||||
def _check_x_axis(self):
|
||||
if self.x_axis <= 0:
|
||||
raise ValidationError("加工行程里x轴不能为0")
|
||||
|
||||
@api.constrains('y_axis')
|
||||
def _check_y_axis(self):
|
||||
if self.y_axis <= 0:
|
||||
raise ValidationError("加工行程里y轴不能为0")
|
||||
|
||||
@api.constrains('z_axis')
|
||||
def _check_z_axis(self):
|
||||
if self.z_axis <= 0:
|
||||
raise ValidationError("加工行程里z轴不能为0")
|
||||
|
||||
@api.constrains('b_axis')
|
||||
def _check_b_axis(self):
|
||||
if self.number_of_axles == '四轴':
|
||||
print(self.number_of_axles)
|
||||
if self.b_axis <= 0:
|
||||
raise ValidationError("加工行程里b轴不能为0")
|
||||
|
||||
@api.constrains('c_axis')
|
||||
def _check_c_axis(self):
|
||||
if self.number_of_axles == '五轴':
|
||||
if self.c_axis <= 0:
|
||||
raise ValidationError("加工行程里c轴不能为0")
|
||||
|
||||
@api.onchange('type_id')
|
||||
def get_type_info(self):
|
||||
for item in self:
|
||||
item.knife_type = item.type_id.knife_type
|
||||
item.number_of_knife_library = item.type_id.number_of_knife_library
|
||||
item.number_of_axles = item.type_id.number_of_axles
|
||||
item.rotate_speed = item.type_id.rotate_speed
|
||||
item.precision = item.type_id.precision
|
||||
item.control_system_id = item.type_id.control_system_id
|
||||
item.x_axis = item.type_id.x_axis
|
||||
item.y_axis = item.type_id.y_axis
|
||||
item.z_axis = item.type_id.z_axis
|
||||
item.b_axis = item.type_id.b_axis
|
||||
item.c_axis = item.type_id.c_axis
|
||||
|
||||
# 注册同步机床
|
||||
def enroll_machine_tool(self):
|
||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||
token = sf_sync_config['token']
|
||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||
headers = Common.get_headers(self, token, sf_secret_key)
|
||||
strurl = sf_sync_config['sf_url'] + self.crea_url
|
||||
objs_all = self.env['sf.machine_tool'].search([('MTcode', '=', self.MTcode)])
|
||||
machine_tool_list = []
|
||||
if objs_all:
|
||||
for item in objs_all:
|
||||
val = {
|
||||
'MTcode': item.MTcode,
|
||||
'factory_token': token,
|
||||
'id': item.id,
|
||||
'name': item.name,
|
||||
'code': item.code,
|
||||
'precision': item.precision,
|
||||
'knife_type': item.knife_type,
|
||||
'number_of_knife_library': item.number_of_knife_library,
|
||||
'rotate_speed': item.rotate_speed,
|
||||
'number_of_axles': item.number_of_axles,
|
||||
'control_system_id': self.env['sf.machine.control_system'].search(
|
||||
[('id', '=', item.control_system_id.id)]).code,
|
||||
'type_id': self.env['sf.machine_tool.type'].search([('id', '=', item.type_id.id)]).code,
|
||||
'brand_id': self.env['sf.machine.brand'].search([('id', '=', item.brand_id.id)]).code,
|
||||
'supplier_id': item.supplier_id.id,
|
||||
'x_axis': item.x_axis,
|
||||
'y_axis': item.y_axis,
|
||||
'z_axis': item.z_axis,
|
||||
'b_axis': item.b_axis,
|
||||
'c_axis': item.c_axis,
|
||||
'state': item.state,
|
||||
'active': item.active,
|
||||
|
||||
}
|
||||
machine_tool_list.append(val)
|
||||
# kw = machine_tool_list
|
||||
kw = json.dumps(machine_tool_list, ensure_ascii=False)
|
||||
r = requests.post(strurl, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
||||
ret = r.json()
|
||||
self.code = ret['message']
|
||||
self.state_zc = "已注册"
|
||||
if r == 200:
|
||||
return "机床注册成功"
|
||||
else:
|
||||
raise ValidationError("没有注册机床信息")
|
||||
|
||||
|
||||
class MachineToolType(models.Model):
|
||||
_name = 'sf.machine_tool.type'
|
||||
_description = '机床型号'
|
||||
# _order = 'priority desc, code, name, id'
|
||||
|
||||
name = fields.Char('名称')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||
knife_type = fields.Selection(
|
||||
[("BT40", "BT40"), ("BT30", "BT30")],
|
||||
default="", string="刀把类型")
|
||||
number_of_knife_library = fields.Integer('刀库数量')
|
||||
rotate_speed = fields.Integer('转速')
|
||||
# 多个型号对应一个机床
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
||||
default="", string="轴数")
|
||||
# 加工进程
|
||||
x_axis = fields.Integer('X轴')
|
||||
y_axis = fields.Integer('Y轴')
|
||||
z_axis = fields.Integer('Z轴')
|
||||
b_axis = fields.Integer('B轴')
|
||||
c_axis = fields.Integer('C轴')
|
||||
remark = fields.Text('备注')
|
||||
precision = fields.Float('加工精度')
|
||||
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||
string="控制系统")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
|
||||
# 刀具
|
||||
class CuttingTool(models.Model):
|
||||
_name = 'sf.cutting_tool.category'
|
||||
_description = '刀具类别'
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class CuttingToolType(models.Model):
|
||||
_name = 'sf.cutting_tool.type'
|
||||
_description = '刀具型号'
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
diameter = fields.Integer('直径')
|
||||
long_blade = fields.Integer('避空长/刃长')
|
||||
cone_angle_pitch = fields.Integer('锥角/节距')
|
||||
shank_diameter = fields.Integer('柄径')
|
||||
taper_shank_length = fields.Integer('锥柄长')
|
||||
tool_length = fields.Integer('刀具总长')
|
||||
blade_number = fields.Integer('刃数')
|
||||
category_id = fields.Many2one('sf.cutting_tool.category', string='刀具类别')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
177
sf_base/models/common.py
Normal file
177
sf_base/models/common.py
Normal file
@@ -0,0 +1,177 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import fields, models
|
||||
import requests
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from urllib.parse import urlencode
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# 材料
|
||||
class MrsProductionMaterials(models.Model):
|
||||
_name = 'sf.production.materials'
|
||||
_description = '材料'
|
||||
|
||||
materials_no = fields.Char("编码")
|
||||
name = fields.Char('名称')
|
||||
partner_ids = fields.Many2many('res.partner', 'materials_ids', '加工工厂')
|
||||
materials_model_ids = fields.One2many('sf.materials.model', 'materials_id', '材料型号')
|
||||
remark = fields.Text("备注")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# def open_url_action(self):
|
||||
# base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
# # url = 'http://192.168.50.202:8080/api'
|
||||
# url = 'https://bfw.jikimo.com/'
|
||||
# # data = {
|
||||
# # 'key' : 'value'
|
||||
# # }
|
||||
#
|
||||
# response = requests.get(url)
|
||||
# response.raise_for_status()
|
||||
# return {
|
||||
# 'type': 'ir.actions.act_url',
|
||||
# 'url': response.url,
|
||||
# 'target': 'new'
|
||||
# }
|
||||
|
||||
|
||||
|
||||
def open_url_action(self):
|
||||
# sf_sync_config = self.env['res.config.settings'].get_values()
|
||||
# token = sf_sync_config['token']
|
||||
# sf_secret_key = sf_sync_config['sf_secret_key']
|
||||
# headers = Common.get_headers(self, token, sf_secret_key)
|
||||
url = 'http://192.168.50.127:8081'
|
||||
params = {
|
||||
'user_id': self._uid
|
||||
}
|
||||
url_params = urlencode(params)
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': url + '?' + url_params,
|
||||
# 'url': url,
|
||||
'target': 'new'
|
||||
}
|
||||
|
||||
|
||||
# 材料型号
|
||||
class MrsMaterialModel(models.Model):
|
||||
_name = 'sf.materials.model'
|
||||
_description = '材料型号'
|
||||
|
||||
materials_no = fields.Char("编码")
|
||||
materials_num = fields.Char("编码号")
|
||||
name = fields.Char('型号名')
|
||||
need_h = fields.Boolean("热处理", default="false")
|
||||
mf_materia_post = fields.Char("热处理后密度")
|
||||
density = fields.Float("密度(kg/m³)")
|
||||
materials_id = fields.Many2one('sf.production.materials', "材料名")
|
||||
remark = fields.Text("备注")
|
||||
gain_way = fields.Selection(
|
||||
[("自加工", "自加工"), ("外协", "外协"), ("采购", "采购")],
|
||||
default="", string="获取方式")
|
||||
supplier_ids = fields.One2many('sf.supplier.sort', 'materials_model_id', string='供应商')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class MrsProductionProcessCategory(models.Model):
|
||||
_name = 'sf.production.process.category'
|
||||
_description = '表面工艺类别'
|
||||
order = 'id desc'
|
||||
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char("编码")
|
||||
sequence = fields.Integer('排序')
|
||||
production_process_ids = fields.One2many('sf.production.process', 'category_id', string="表面工艺")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 工艺 编码,名称,备注
|
||||
class MrsProductionProcess(models.Model):
|
||||
_name = 'sf.production.process'
|
||||
_description = '表面工艺'
|
||||
|
||||
process_encode = fields.Char("编码")
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Text("备注")
|
||||
processing_order_ids = fields.One2many('sf.processing.order', 'production_process_id', string='工序')
|
||||
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
|
||||
category_id = fields.Many2one('sf.production.process.category')
|
||||
# workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True)
|
||||
|
||||
|
||||
class MrsProcessingTechnology(models.Model):
|
||||
_name = 'sf.processing.technology'
|
||||
_description = '加工工艺'
|
||||
|
||||
name = fields.Char('名称', index=True)
|
||||
remark = fields.Text('备注', index=True)
|
||||
process_encode = fields.Char("编码")
|
||||
processing_order_ids = fields.Many2many('sf.processing.order', 'sf_associated_processes',
|
||||
index=True, string='工序')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class MrsProcessingOrder(models.Model):
|
||||
_name = 'sf.processing.order'
|
||||
_description = '工序'
|
||||
sequence = fields.Integer('Sequence')
|
||||
processing_technology_ids = fields.Many2many('sf.processing.technology', 'sf_associated_processes',
|
||||
index=True, string='加工工艺')
|
||||
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||
|
||||
|
||||
class Tray(models.Model):
|
||||
_name = 'sf.tray'
|
||||
_description = '托盘'
|
||||
|
||||
code = fields.Char('编码', copy=False)
|
||||
name = fields.Char('名称')
|
||||
state = fields.Selection(
|
||||
[("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
||||
default="空闲", string="状态")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class SupplierSort(models.Model):
|
||||
_name = 'sf.supplier.sort'
|
||||
_description = '供应商排序'
|
||||
|
||||
sequence = fields.Integer('Sequence')
|
||||
partner_id = fields.Many2one('res.partner', domain="[('is_company', '=', True),('supplier_rank', '!=', 0)]")
|
||||
materials_model_id = fields.Many2one('sf.materials.model')
|
||||
|
||||
_sql_constraints = [
|
||||
('supplier_sort_uniq', 'unique (partner_id,materials_model_id)', '排序不能重复!')
|
||||
]
|
||||
|
||||
|
||||
class MrsProductionProcessParameter(models.Model):
|
||||
_name = 'sf.production.process.parameter'
|
||||
_description = '可选参数'
|
||||
# _display_name = 'name'
|
||||
|
||||
code = fields.Char("编码")
|
||||
name = fields.Char('名称')
|
||||
gain_way = fields.Selection([("自加工", "自加工"), ("外协", "外协")], default="", string="获取方式")
|
||||
is_check = fields.Boolean(default=False)
|
||||
# price = fields.Float('单价')
|
||||
process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||
materials_model_ids = fields.Many2many('sf.materials.model', 'applicable_material', string='适用材料')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
for parameter in self:
|
||||
if parameter.process_id:
|
||||
name = parameter.process_id.name + '-' + parameter.name
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
|
||||
# 获取表面工艺的获取方式
|
||||
def get_gain_way(self, item):
|
||||
process_parameter = self.env['sf.production.process.parameter'].search([('id', '=', item.id)])
|
||||
return process_parameter
|
||||
4
sf_base/security/group_security.xml
Normal file
4
sf_base/security/group_security.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<odoo>
|
||||
<data>
|
||||
</data>
|
||||
</odoo>
|
||||
23
sf_base/security/ir.model.access.csv
Normal file
23
sf_base/security/ir.model.access.csv
Normal file
@@ -0,0 +1,23 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_category,sf_cutting_tool_category,model_sf_cutting_tool_category,base.group_user,1,1,1,1
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,1
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,base.group_user,1,1,1,1
|
||||
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,1
|
||||
access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_control_system,base.group_user,1,1,1,1
|
||||
access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,1
|
||||
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,1
|
||||
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,1
|
||||
access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,1,1,1,1
|
||||
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,1
|
||||
access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
503
sf_base/views/base_view.xml
Normal file
503
sf_base/views/base_view.xml
Normal file
@@ -0,0 +1,503 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
#------------------品牌------------------
|
||||
<record model="ir.ui.view" id="search_sf_machine_brand_view">
|
||||
<field name="name">search.sf.machine.brand</field>
|
||||
<field name="model">sf.machine.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="品牌">
|
||||
<!-- <field name="name" string="名称"-->
|
||||
<!-- filter_domain="[('name', 'ilike', self)]"/>-->
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('code', 'ilike', self)]"/>
|
||||
<group string="分组">
|
||||
<filter name="tag_ids" string="标签" domain="[]" context="{'group_by': 'tag_ids'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_machine_brand_view">
|
||||
<field name="name">tree.sf.machine.brand</field>
|
||||
<field name="model">sf.machine.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="品牌">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_sf_machine_brand">
|
||||
<field name="name">form.sf.machine.brand</field>
|
||||
<field name="model">sf.machine.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="品牌">
|
||||
<!-- <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>-->
|
||||
<field name="image_brand" widget='image' class="oe_avatar" options="{'preview_image': 'image_128'}"/>
|
||||
<div class="oe_title">
|
||||
<label for="code" string="编码"/>
|
||||
<h2 class="d-flex">
|
||||
<field name="code" readonly="True"/>
|
||||
</h2>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" required="True"/>
|
||||
<field name="tag_ids"
|
||||
widget="many2many_tags"
|
||||
options="{'color_field': 'color', 'no_create_edit': True}"
|
||||
required="True"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_machine_brand" model="ir.actions.act_window">
|
||||
<field name="name">品牌</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.machine.brand</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[品牌] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------机床型号------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_machine_tool_type_view">
|
||||
<field name="name">search.sf.machine_tool.type</field>
|
||||
<field name="model">sf.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="机床型号">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('remark', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_machine_tool_type_view">
|
||||
<field name="name">tree.sf.machine_tool.type</field>
|
||||
<field name="model">sf.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="机床型号">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_sf_machine_tool_type">
|
||||
<field name="name">form.sf.machine_tool.type</field>
|
||||
<field name="model">sf.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床型号">
|
||||
<group string="基本信息" name="base_info">
|
||||
<group>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"
|
||||
options="{'no_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="参数">
|
||||
<group>
|
||||
<field name="knife_type" required="1"/>
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<field name="number_of_axles" required="1" widget="radio" options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||
<label for="x_axis" string="x"/>
|
||||
<field name="x_axis" class="o_address_city" required="1" options="{'format': false}"/>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" required="1" options="{'format': false}"/>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1" options="{'format': false}"/>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
|
||||
<field name="b_axis" class="o_address_city" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
|
||||
options="{'format': false}"/>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="rotate_speed" string="转速(min)" required="1" options="{'format': false}"/>
|
||||
<field name="precision" required="1" string="加工精度(mm)"/>
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_machine_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">机床型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.machine_tool.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[机床型号] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------刀具型号------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_cutting_tool_type_view">
|
||||
<field name="name">search.sf.cutting_tool.type</field>
|
||||
<field name="model">sf.cutting_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀具型号">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('code', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_cutting_tool_type_view">
|
||||
<field name="name">tree.sf.cutting_tool.type</field>
|
||||
<field name="model">sf.cutting_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀具型号">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_sf_cutting_tool_type">
|
||||
<field name="name">form.sf.cutting_tool.type</field>
|
||||
<field name="model">sf.cutting_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具型号">
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="category_id" string="类别" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="刀具参数">
|
||||
<group>
|
||||
<field name="taper_shank_length" required="1" options="{'format': false}"/>
|
||||
<field name="long_blade" required="1" options="{'format': false}"/>
|
||||
<field name="tool_length" required="1" options="{'format': false}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="diameter" required="1" options="{'format': false}"/>
|
||||
<field name="shank_diameter" required="1" options="{'format': false}"/>
|
||||
<field name="cone_angle_pitch" required="1" options="{'format': false}"/>
|
||||
<field name="blade_number" required="1" options="{'format': false}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_cutting_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">刀具型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting_tool.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[刀具型号] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------刀具类别------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_cutting_tool_category_view">
|
||||
<field name="name">search.sf.cutting_tool.category</field>
|
||||
<field name="model">sf.cutting_tool.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀具类别">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('remark', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_cutting_tool_category_view">
|
||||
<field name="name">tree.sf.cutting_tool.category</field>
|
||||
<field name="model">sf.cutting_tool.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀具类别">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sf_cutting_tool_category_form">
|
||||
<field name="name">form.sf.cutting_tool.category</field>
|
||||
<field name="model">sf.cutting_tool.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具类别">
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="code" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<!-- <group string="参数">-->
|
||||
<!-- <field name="type_ids" string="刀具型号">-->
|
||||
<!-- <tree editable="bottom">-->
|
||||
<!-- <field name="category_id" invisible="True"/>-->
|
||||
<!-- <field name="code" string="编码" required="True"/>-->
|
||||
<!-- <field name="name" string="名称" required="True"/>-->
|
||||
<!-- <field name="diameter" string="直径" required="True"/>-->
|
||||
<!-- <field name="long_blade" string="避空长/刃长" required="True"/>-->
|
||||
<!-- <field name="cone_angle_pitch" string="锥角/节距" required="True"/>-->
|
||||
<!-- <field name="shank_diameter" string="柄径" required="True"/>-->
|
||||
<!-- <field name="taper_shank_length" string="锥柄" required="True"/>-->
|
||||
<!-- <field name="tool_length" string="刀具总长" required="True"/>-->
|
||||
<!-- <field name="blade_number" string="刃数" required="True"/>-->
|
||||
<!-- <field name="remark" string="备注"/>-->
|
||||
<!-- <field name="active" string="有效"/>-->
|
||||
<!-- </tree>-->
|
||||
<!-- </field>-->
|
||||
<!-- </group>-->
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_cutting_tool_category" model="ir.actions.act_window">
|
||||
<field name="name">刀具类别</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting_tool.category</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[刀具类别] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------机床注册------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_machine_tool_view">
|
||||
<field name="name">search.sf.machine_tool</field>
|
||||
<field name="model">sf.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="机床">
|
||||
<field name="name" string="名称" filter_domain="[('name', 'ilike', self)]"/>
|
||||
<field name="type_id" string="型号" filter_domain="[('type_id', 'ilike', self)]"/>
|
||||
<searchpanel>
|
||||
<field name="brand_id" icon="fa-building" enable_counters="1"/>
|
||||
<!-- <field name="type_id" icon="fa-users" enable_counters="1"/>-->
|
||||
</searchpanel>
|
||||
</search>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_machine_tool_view">
|
||||
<field name="name">tree.sf.machine_tool</field>
|
||||
<field name="model">sf.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="机床">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="type_id"/>
|
||||
<field name="state_zc"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sf_machine_tool_form">
|
||||
<field name="name">form.sf.machine_tool</field>
|
||||
<field name="model">sf.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床">
|
||||
<header>
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册" attrs="{'invisible': [('code','!=',False)]}"/>
|
||||
</header>
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="MTcode" string="编码"/>
|
||||
|
||||
|
||||
<field name="brand_id"
|
||||
required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"
|
||||
options="{'no_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}"
|
||||
domain="[('brand_id', '=', brand_id)]" attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<field name="code" readonly="1" string="行业编码" force_save="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="参数">
|
||||
<group string="参数">
|
||||
<group>
|
||||
<field name="knife_type" required="1"/>
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<field name="number_of_axles" widget="radio" options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||
<label for="x_axis" string="x"/>
|
||||
<field name="x_axis" class="o_address_city" required="1" options="{'format': false}"/>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" required="1" options="{'format': false}"/>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1" options="{'format': false}"/>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
|
||||
<field name="b_axis" class="o_address_city" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
|
||||
options="{'format': false}"/>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="rotate_speed" required="1" string="转速(min)" options="{'format': false}"/>
|
||||
<field name="precision" required="1" string="加工精度(mm)"/>
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
<field name="state" widget="selection"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="其他">
|
||||
<group string="其他">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_machine_tool" model="ir.actions.act_window">
|
||||
<field name="name">机床</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.machine_tool</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<!-- <field name="search_view_id" ref="view_okr_filter"/>-->
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[机床] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------控制系统------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_sf_machine_control_system_view">
|
||||
<field name="name">search.sf.machine.control_system</field>
|
||||
<field name="model">sf.machine.control_system</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="控制系统">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('code', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_machine_control_system_view">
|
||||
<field name="name">tree.sf.machine.control_system</field>
|
||||
<field name="model">sf.machine.control_system</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="控制系统">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="brand_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_sf_machine_control_system">
|
||||
<field name="name">form.sf.machine.control_system</field>
|
||||
<field name="model">sf.machine.control_system</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="控制系统">
|
||||
<group>
|
||||
<group>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '控制系统')]"
|
||||
options="{'no_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_machine_control_system" model="ir.actions.act_window">
|
||||
<field name="name">控制系统</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.machine.control_system</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[控制系统] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
332
sf_base/views/common_view.xml
Normal file
332
sf_base/views/common_view.xml
Normal file
@@ -0,0 +1,332 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!--加工工艺-->
|
||||
<record model="ir.ui.view" id="sf_processing_technology_form">
|
||||
<field name="model">sf.processing.technology</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="加工工艺">
|
||||
<group>
|
||||
<group>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sf_processing_technology_tree">
|
||||
<field name="model">sf.processing.technology</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加工工艺">
|
||||
<field name="process_encode"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="search_sf_processing_technology_view">
|
||||
<field name="name">search.sf.processing.technology.type</field>
|
||||
<field name="model">sf.processing.technology</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="process_encode" string="编码搜索" filter_domain="[('process_encode','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!--表面工艺-->
|
||||
<record model="ir.ui.view" id="sf_production_process_tree">
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="表面工艺">
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sf_production_process_form">
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="表面工艺">
|
||||
<group>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
<page string="工序">
|
||||
<field name='processing_order_ids' options="{'no_create':True}" widget="one2many">
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="processing_technology_ids" widget="many2many_tags">
|
||||
</field>
|
||||
</tree>
|
||||
<form>
|
||||
<field name="processing_technology_ids" widget="many2many">
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="search_sf_production_process_view">
|
||||
<field name="name">search.sf.production.process.type</field>
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="process_encode" string="编码搜索" filter_domain="[('process_encode','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!--材料型号-->
|
||||
<record model="ir.ui.view" id="sf_materials_model_form">
|
||||
<field name="model">sf.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="材料型号">
|
||||
<group>
|
||||
<group>
|
||||
<field name="materials_no" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="gain_way" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="density" required="1"/>
|
||||
<field name="need_h" default="false"/>
|
||||
<field name="mf_materia_post" attrs="{'invisible':[('need_h','=',False)]} "/>
|
||||
</group>
|
||||
<group>
|
||||
<field name='materials_id' default="default" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name='supplier_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle" string="序号"/>
|
||||
<field name="partner_id" string="名称"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sf_materials_model_tree">
|
||||
<field name="model">sf.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="材料型号">
|
||||
<field name="materials_no"/>
|
||||
<field name="name"/>
|
||||
<field name="need_h"/>
|
||||
<field name="density"/>
|
||||
<field name='materials_id' invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="search_sf_materials_model_type_view">
|
||||
<field name="name">search.sf.materials.model.type</field>
|
||||
<field name="model">sf.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="materials_id" icon="fa-filter"/>
|
||||
</searchpanel>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!--材料-->
|
||||
<record model="ir.ui.view" id="sf_production_materials_form">
|
||||
<field name="model">sf.production.materials</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="材料">
|
||||
|
||||
<group string="详情">
|
||||
<group>
|
||||
<field name="materials_no" readonly="1" default="编码"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<field name="materials_model_ids" widget="ony2many">
|
||||
<tree string="材料型号">
|
||||
<field name="materials_no"/>
|
||||
<field name="name"/>
|
||||
<field name="need_h"/>
|
||||
<field name="mf_materia_post"/>
|
||||
<field name="density"/>
|
||||
<field name='materials_id' default="default" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sf_production_materials_tree">
|
||||
<field name="model">sf.production.materials</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="材料">
|
||||
<field name="materials_no" readonly="1"/>
|
||||
<field name="name" readonly="1"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="search_sf_production_materials_view">
|
||||
<field name="name">search.sf.production.materials.type</field>
|
||||
<field name="model">sf.production.materials</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record model="ir.ui.view" id="sf_production_materials_form">-->
|
||||
<!-- <field name="model">sf.production.materials</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="材料">-->
|
||||
|
||||
<!-- <group string="详情">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="materials_no" required="1" default="编码"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name" required="1"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <field name="materials_model_ids">-->
|
||||
|
||||
<!-- </field>-->
|
||||
<!-- </group>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="sf_production_materials" model="ir.actions.act_window">
|
||||
<field name="name">材料</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.production.materials</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
材料!
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="sf_production_process" model="ir.actions.act_window">
|
||||
<field name="name">表面工艺</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.production.process</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
表面工艺!
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="sf_materials_model" model="ir.actions.act_window">
|
||||
<field name="name">材料型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.materials.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
材料型号!
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="sf_processing_technology" model="ir.actions.act_window">
|
||||
<field name="name">加工工艺</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.processing.technology</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
加工工艺!
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------托盘------------------
|
||||
<record id="action_sf_tray" model="ir.actions.act_window">
|
||||
<field name="name">托盘</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.tray</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
创建托盘吧
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tray_search" model="ir.ui.view">
|
||||
<field name="name">sf.tray.search</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="托盘">
|
||||
<field name="name" string="名称" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码" filter_domain="[('code','ilike',self)]"/>
|
||||
<group string="分组">
|
||||
<filter name="state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_sf_tray_view">
|
||||
<field name="name">sf.tray.tree</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="托盘">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sf_tray_form">
|
||||
<field name="name">sf.tray.form</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="托盘">
|
||||
<header>
|
||||
<field name='state' widget="radio" options="{'horizontal': True}"/>
|
||||
</header>
|
||||
<group string="基本信息" name="group1">
|
||||
<group>
|
||||
<field name="code" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
145
sf_base/views/menu_view.xml
Normal file
145
sf_base/views/menu_view.xml
Normal file
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- <menuitem action="mrp_production_action"-->
|
||||
<!-- id="menu_mrp_production_action"-->
|
||||
<!-- parent="menu_mrp_manufacturing"-->
|
||||
<!-- sequence="1"/>-->
|
||||
<!-- name="Manufacturing-->
|
||||
<!-- menu_mrp_configuration-->
|
||||
<!--parent="menu_mrp_configuration"-->
|
||||
<!-- <menuitem id="menu_mrp_config"
|
||||
name="Settings"
|
||||
parent="menu_mrp_configuration"
|
||||
sequence="0"
|
||||
action="action_mrp_configuration"
|
||||
groups="base.group_system"/>-->
|
||||
<menuitem
|
||||
id="menu_sf_machine_tool"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
name="机床"
|
||||
sequence="1"
|
||||
action="action_sf_machine_tool"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_tray"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
name="托盘"
|
||||
sequence="9"
|
||||
action="action_sf_tray"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
sequence="2"
|
||||
name="基础数据"
|
||||
id="menu_sf_base"
|
||||
action="sf_production_materials"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_production_materials_1"
|
||||
name="原材料"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="3"
|
||||
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_production_process_1"
|
||||
name="工艺"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="4"
|
||||
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_production_process"
|
||||
name="表面工艺"
|
||||
parent="menu_sf_production_process_1"
|
||||
sequence="1"
|
||||
action="sf_production_process"
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_production_materials"
|
||||
name="材料"
|
||||
parent="menu_sf_production_materials_1"
|
||||
sequence="1"
|
||||
action="sf_production_materials"
|
||||
|
||||
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_sf_materials_model"
|
||||
name="材料型号"
|
||||
parent="menu_sf_production_materials_1"
|
||||
sequence="1"
|
||||
action="sf_materials_model"
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_processing_technology"
|
||||
name="加工工艺"
|
||||
parent="menu_sf_production_process_1"
|
||||
sequence="1"
|
||||
action="sf_processing_technology"/>
|
||||
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_partner_views"-->
|
||||
<!-- name="工厂token"-->
|
||||
<!-- parent="menu_sf_base"-->
|
||||
<!-- sequence="1"-->
|
||||
<!-- action="token_factory_view"-->
|
||||
<!-- />-->
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_machine_brand"
|
||||
parent="menu_sf_base"
|
||||
name="品牌"
|
||||
sequence="1"
|
||||
action="action_sf_machine_brand"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_machine_tool_type"
|
||||
parent="menu_sf_base"
|
||||
name="机床型号"
|
||||
sequence="1"
|
||||
action="action_sf_machine_tool_type"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
name="刀具"
|
||||
sequence="5"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_category"
|
||||
parent="menu_sf_cutting_tool"
|
||||
name="刀具类别"
|
||||
sequence="1"
|
||||
action="action_sf_cutting_tool_category"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_type"
|
||||
parent="menu_sf_cutting_tool"
|
||||
name="刀具型号"
|
||||
sequence="1"
|
||||
action="action_sf_cutting_tool_type"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_machine_control_system"
|
||||
parent="menu_sf_base"
|
||||
name="控制系统"
|
||||
sequence="1"
|
||||
action="action_sf_machine_control_system"/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user