初次提交,智能工厂基础数据
This commit is contained in:
1
sf_base/__init__.py
Normal file
1
sf_base/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
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': 'YZ',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/mrs_base_view.xml',
|
||||
'views/mrs_common_view.xml',
|
||||
"views/menu_view.xml"
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
3
sf_base/models/__init__.py
Normal file
3
sf_base/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
from. import sf_base
|
||||
from. import sf_common
|
||||
237
sf_base/models/sf_base.py
Normal file
237
sf_base/models/sf_base.py
Normal file
@@ -0,0 +1,237 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MachineBrandTags(models.Model):
|
||||
_name = 'mrs.machine.brand.tags'
|
||||
_description = '标签'
|
||||
|
||||
name = fields.Char('名称', size=50)
|
||||
color = fields.Integer('颜色', default=0)
|
||||
|
||||
|
||||
class MachineControlSystem(models.Model):
|
||||
_name = 'mrs.machine_tool.type.control_system'
|
||||
_description = '控制系统'
|
||||
|
||||
name = fields.Char('名称', size=50)
|
||||
# type_id = fields.Many2one('mrs.machine_tool.type')
|
||||
|
||||
|
||||
# 品牌标签
|
||||
class MachineBrand(models.Model):
|
||||
_name = 'mrs.machine.brand'
|
||||
_description = '品牌'
|
||||
|
||||
name = fields.Char('名称')
|
||||
tag_ids = fields.Many2many('mrs.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 = 'mrs.machine_tool'
|
||||
_description = '机床'
|
||||
|
||||
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(
|
||||
[("3轴", "3轴"), ("4轴", "4轴"), ("5轴", "5轴")],
|
||||
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('mrs.machine_tool.type.control_system',
|
||||
string="控制系统")
|
||||
# 多个机床型号对应一个机床
|
||||
type_id = fields.Many2one('mrs.machine_tool.type', '型号',
|
||||
compute='_compute_type_id')
|
||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
||||
status = 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('注册日期')
|
||||
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.depends('type_id')
|
||||
# def _compute_type_id(self):
|
||||
# to_reset = self.filtered(lambda e: e.type_id != e.type_id.id)
|
||||
# to_reset.type_id = False
|
||||
|
||||
# 编码规则:加工工厂编码-品牌编码-注册年月-00001
|
||||
# def get_machine_tool_code(self):
|
||||
# partner = self.env['res.partner'].sudo().search(
|
||||
# [('is_factory', '=', True)],
|
||||
# limit=1,
|
||||
# order="id desc")
|
||||
# brand = self.env['mrs.machine.brand'].sudo().search(
|
||||
# [('tag_ids', '=', '机床')],
|
||||
# limit=1,
|
||||
# order="id desc")
|
||||
# if not brand:
|
||||
# num = item.brand_id.code + "%04d" % 1
|
||||
# item.code = num
|
||||
# else:
|
||||
# print('--------')
|
||||
# print(type)
|
||||
# m = int(type.code[-4:]) + 1
|
||||
# num = item.brand_id.code + "%04d" % m
|
||||
# item.code = num
|
||||
|
||||
# 选择机床型号时,该型号的基本信息带出并赋给机床对应的信息里
|
||||
|
||||
# @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
|
||||
|
||||
|
||||
class MachineToolType(models.Model):
|
||||
_name = 'mrs.machine_tool.type'
|
||||
_description = '机床型号'
|
||||
# _order = 'priority desc, code, name, id'
|
||||
|
||||
name = fields.Char('名称')
|
||||
brand_id = fields.Many2one('mrs.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('mrs.machine_tool', '机床')
|
||||
number_of_axles = fields.Selection(
|
||||
[("3轴", "3轴"), ("4轴", "4轴"), ("5轴", "5轴")],
|
||||
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('mrs.machine_tool.type.control_system',
|
||||
string="控制系统")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
# @api.onchange('brand_id')
|
||||
# def get_machine_tool_type_code(self):
|
||||
# for item in self:
|
||||
# if not item.brand_id:
|
||||
# return False
|
||||
# type = self.env['mrs.machine_tool.type'].sudo().search(
|
||||
# [('brand_id', '=', item.brand_id.id)],
|
||||
# limit=1,
|
||||
# order="id desc"
|
||||
# )
|
||||
# print(item.brand_id.id)
|
||||
# if not type:
|
||||
# num = item.brand_id.code + "%04d" % 1
|
||||
# item.code = num
|
||||
# print(item.code)
|
||||
# else:
|
||||
# print('----------')
|
||||
# m = int(type.code[-4:]) + 1
|
||||
# num = item.brand_id.code + "%04d" % m
|
||||
# item.code = num
|
||||
# print(item.code)
|
||||
|
||||
|
||||
# 刀具
|
||||
class CuttingTool(models.Model):
|
||||
_name = 'mrs.cutting_tool.category'
|
||||
_description = '刀具类别'
|
||||
|
||||
# def get_cutting_tool_category_code(self):
|
||||
# code = self.env['mrs.cutting_tool.category'].sudo().search(
|
||||
# [('code', '!=', False)], limit=1,
|
||||
# order="id desc")
|
||||
# if not code:
|
||||
# num = "%03d" % 1
|
||||
# else:
|
||||
# m = int(code.code) + 1
|
||||
# num = "%03d" % m
|
||||
# return num
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# type_ids = fields.One2many('mrs.cutting_tool.type', 'category_id', string='刀具型号')
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class CuttingToolType(models.Model):
|
||||
_name = 'mrs.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('mrs.cutting_tool.category', string='刀具类别')
|
||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.onchange('brand_id', 'category_id')
|
||||
# def get_cutting_tool_type_code(self):
|
||||
# for item in self:
|
||||
# if not item.brand_id:
|
||||
# return False
|
||||
# if not item.category_id:
|
||||
# return False
|
||||
# type = self.env['mrs.cutting_tool.type'].sudo().search(
|
||||
# [('brand_id', '=', item.brand_id.id), ('brand_id', '=', item.category_id.id)],
|
||||
# limit=1,
|
||||
# order="id desc"
|
||||
# )
|
||||
# if not type:
|
||||
# num = item.brand_id.code + item.category_id.code + "%03d" % 1
|
||||
# item.code = num
|
||||
# else:
|
||||
# m = int(type.code[-4:]) + 1
|
||||
# num = item.brand_id.code + item.category_id.code + "%03d" % m
|
||||
# item.code = num
|
||||
54
sf_base/models/sf_common.py
Normal file
54
sf_base/models/sf_common.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import fields, models, api
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# 材料
|
||||
class MrsProductionMaterials(models.Model):
|
||||
_name = 'mrs.production.materials'
|
||||
_description = '材料'
|
||||
remark = fields.Text("备注")
|
||||
name = fields.Char('名称')
|
||||
partner_ids = fields.Many2many('res.partner', 'materials_ids', '加工工厂')
|
||||
materials_model_ids = fields.One2many('mrs.materials.model', 'materials_id', '材料型号')
|
||||
materials_no = fields.Char("编码")
|
||||
|
||||
|
||||
# 材料型号
|
||||
class MrsMaterialModel(models.Model):
|
||||
_name = 'mrs.materials.model'
|
||||
_description = '材料型号'
|
||||
remark = fields.Text("备注")
|
||||
name = fields.Char('型号名')
|
||||
need_h = fields.Boolean("需要热处理", default="false")
|
||||
mf_materia_post = fields.Char("热处理后硬度")
|
||||
density = fields.Float("密度(kg/m³)")
|
||||
materials_id = fields.Many2one('mrs.production.materials', "材料名")
|
||||
materials_num = fields.Char("编码号")
|
||||
material_no = fields.Char("编码")
|
||||
|
||||
|
||||
# 工艺 编码,名称,备注
|
||||
class MrsProductionProcess(models.Model):
|
||||
_name = 'mrs.production.process'
|
||||
_description = '表面工艺'
|
||||
name = fields.Char('表面工艺')
|
||||
remark = fields.Text("备注")
|
||||
processing_technology_ids = fields.Many2many('mrs.processing.technology', 'mrs_associated_processes',
|
||||
index=True)
|
||||
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
|
||||
process_encode = fields.Char("编码")
|
||||
|
||||
|
||||
class MrsProcessingTechnology(models.Model):
|
||||
_name = 'mrs.processing.technology'
|
||||
_description = '加工工艺'
|
||||
remark = fields.Text("备注")
|
||||
sequence = fields.Integer('Sequence', index=True)
|
||||
name = fields.Char('加工工艺', index=True)
|
||||
remark = fields.Text('备注', index=True)
|
||||
process_encode = fields.Char("编码")
|
||||
production_process_ids = fields.Many2many('mrs.production.process', 'mrs_associated_processes',
|
||||
index=True)
|
||||
5
sf_base/security/group_security.xml
Normal file
5
sf_base/security/group_security.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
18
sf_base/security/ir.model.access.csv
Normal file
18
sf_base/security/ir.model.access.csv
Normal file
@@ -0,0 +1,18 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_mrs_machine_tool,mrs_machine_tool,model_mrs_machine_tool,base.group_user,1,1,1,1
|
||||
access_mrs_cutting_tool_category,mrs_cutting_tool_category,model_mrs_cutting_tool_category,base.group_user,1,1,1,1
|
||||
access_mrs_machine_tool_type,mrs_machine_tool_type,model_mrs_machine_tool_type,base.group_user,1,1,1,1
|
||||
access_mrs_cutting_tool_type,mrs_cutting_tool_type,model_mrs_cutting_tool_type,base.group_user,1,1,1,1
|
||||
access_mrs_machine_brand,mrs_machine_brand,model_mrs_machine_brand,base.group_user,1,1,1,1
|
||||
access_mrs_machine_brand_tags,mrs_machine_brand_tags,model_mrs_machine_brand_tags,base.group_user,1,1,1,1
|
||||
access_mrs_machine_tool_type_control_system,mrs_machine_tool_type_control_system,model_mrs_machine_tool_type_control_system,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
access_mrs_production_process,mrs_production_process,model_mrs_production_process,base.group_user,1,1,1,1
|
||||
access_mrs_production_materials,mrs_production_materials,model_mrs_production_materials,base.group_user,1,1,1,1
|
||||
access_mrs_materials_model,mrs_materials_model,model_mrs_materials_model,base.group_user,1,1,1,1
|
||||
access_mrs_processing_technology,mrs_processing_technology,model_mrs_processing_technology,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
118
sf_base/views/menu_view.xml
Normal file
118
sf_base/views/menu_view.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
|
||||
<menuitem sequence="0"
|
||||
name="基础数据"
|
||||
id="menu_mrs_base"
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_mrs_production_materials_1"
|
||||
name="原材料"
|
||||
parent="menu_mrs_base"
|
||||
sequence="1"
|
||||
action="mrs_production_materials"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_product_template"
|
||||
name="产品"
|
||||
parent="menu_mrs_base"
|
||||
sequence="1"
|
||||
action="sf_product_template"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_production_process_1"
|
||||
name="工艺"
|
||||
parent="menu_mrs_base"
|
||||
sequence="1"
|
||||
action="mrs_production_process"
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_production_process"
|
||||
name="表面工艺"
|
||||
parent="menu_mrs_production_process_1"
|
||||
sequence="2"
|
||||
action="mrs_production_process"
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_production_materials"
|
||||
name="材料"
|
||||
parent="menu_mrs_production_materials_1"
|
||||
sequence="2"
|
||||
action="mrs_production_materials"
|
||||
|
||||
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_mrs_materials_model"
|
||||
name="材料型号"
|
||||
parent="menu_mrs_production_materials_1"
|
||||
sequence="2"
|
||||
action="mrs_materials_model"
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_processing_technology"
|
||||
name="加工工艺"
|
||||
parent="menu_mrs_production_process_1"
|
||||
sequence="2"
|
||||
action="mrs_processing_technology"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_machine_brand"
|
||||
parent="menu_mrs_base"
|
||||
name="品牌"
|
||||
sequence="1"
|
||||
action="action_mrs_machine_brand"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_machine_tool_type"
|
||||
parent="menu_mrs_base"
|
||||
name="机床型号"
|
||||
sequence="1"
|
||||
action="action_mrs_machine_tool_type"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool"
|
||||
parent="menu_mrs_base"
|
||||
name="刀具"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool_category"
|
||||
parent="menu_mrs_cutting_tool"
|
||||
name="刀具类别"
|
||||
sequence="2"
|
||||
action="action_mrs_cutting_tool_category"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool_type"
|
||||
parent="menu_mrs_cutting_tool"
|
||||
name="刀具型号"
|
||||
sequence="2"
|
||||
action="action_mrs_cutting_tool_type"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
315
sf_base/views/mrs_base_view.xml
Normal file
315
sf_base/views/mrs_base_view.xml
Normal file
@@ -0,0 +1,315 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
#------------------品牌------------------
|
||||
<record model="ir.ui.view" id="search_mrs_machine_brand_view">
|
||||
<field name="name">search.mrs.machine.brand</field>
|
||||
<field name="model">mrs.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_mrs_machine_brand_view">
|
||||
<field name="name">tree.mrs.machine.brand</field>
|
||||
<field name="model">mrs.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_mrs_machine_brand">
|
||||
<field name="name">form.mrs.machine.brand</field>
|
||||
<field name="model">mrs.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_mrs_machine_brand" model="ir.actions.act_window">
|
||||
<field name="name">品牌</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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_mrs_machine_tool_type_view">
|
||||
<field name="name">search.mrs.machine_tool.type</field>
|
||||
<field name="model">mrs.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_mrs_machine_tool_type_view">
|
||||
<field name="name">tree.mrs.machine_tool.type</field>
|
||||
<field name="model">mrs.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_mrs_machine_tool_type">
|
||||
<field name="name">form.mrs.machine_tool.type</field>
|
||||
<field name="model">mrs.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床型号">
|
||||
<group string="基本信息">
|
||||
<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', '=', '机床')]"/>
|
||||
</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"/>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" required="1"/>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1"/>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '3轴')]}"/>
|
||||
<field name="b_axis" class="o_address_city" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '3轴')]}"/>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['3轴','4轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['3轴','4轴'])]}"/>
|
||||
</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" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_mrs_machine_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">机床型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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_mrs_cutting_tool_type_view">
|
||||
<field name="name">search.mrs.cutting_tool.type</field>
|
||||
<field name="model">mrs.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.mrs.cutting_tool.type</field>
|
||||
<field name="model">mrs.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_mrs_cutting_tool_type">
|
||||
<field name="name">form.mrs.cutting_tool.type</field>
|
||||
<field name="model">mrs.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_mrs_cutting_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">刀具型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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_mrs_cutting_tool_category_view">
|
||||
<field name="name">search.mrs.cutting_tool.category</field>
|
||||
<field name="model">mrs.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_mrs_cutting_tool_category_view">
|
||||
<field name="name">tree.mrs.cutting_tool.category</field>
|
||||
<field name="model">mrs.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="mrs_cutting_tool_category_form">
|
||||
<field name="name">form.mrs.cutting_tool.category</field>
|
||||
<field name="model">mrs.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_mrs_cutting_tool_category" model="ir.actions.act_window">
|
||||
<field name="name">刀具类别</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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>
|
||||
</odoo>
|
||||
315
sf_base/views/mrs_common_view.xml
Normal file
315
sf_base/views/mrs_common_view.xml
Normal file
@@ -0,0 +1,315 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!--加工工艺-->
|
||||
<record model="ir.ui.view" id="mrs_processing_technology_form">
|
||||
<field name="model">mrs.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="mrs_processing_technology_tree">
|
||||
<field name="model">mrs.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_mrs_processing_technology_view">
|
||||
<field name="name">search.mrs.processing.technology.type</field>
|
||||
<field name="model">mrs.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="mrs_production_process_tree">
|
||||
<field name="model">mrs.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="mrs_production_process_form">
|
||||
<field name="model">mrs.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_technology_ids' widget="many2many">
|
||||
<tree editable="bottom" widget="selection">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="search_mrs_production_process_view">
|
||||
<field name="name">search.mrs.production.process.type</field>
|
||||
<field name="model">mrs.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="mrs_materials_model_form">
|
||||
<field name="model">mrs.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="材料型号">
|
||||
<group>
|
||||
<group>
|
||||
<field name="material_no" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<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"/>
|
||||
<field name="density" required="1"/>
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="mrs_materials_model_tree">
|
||||
<field name="model">mrs.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="材料型号">
|
||||
<field name="material_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_mrs_materials_model_type_view">
|
||||
<field name="name">search.mrs.materials.model.type</field>
|
||||
<field name="model">mrs.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="material_no" string="编码搜索" filter_domain="[('material_no','ilike',self)]"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="materials_id" icon="fa-filter"/>
|
||||
</searchpanel>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!--材料-->
|
||||
<record model="ir.ui.view" id="mrs_production_materials_form">
|
||||
<field name="model">mrs.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="material_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="mrs_production_materials_tree">
|
||||
<field name="model">mrs.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_mrs_production_materials_view">
|
||||
<field name="name">search.mrs.production.materials.type</field>
|
||||
<field name="model">mrs.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="mrs_production_materials_form">-->
|
||||
<!-- <field name="model">mrs.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="mrs_production_materials" model="ir.actions.act_window">
|
||||
<field name="name">材料</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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="mrs_production_process" model="ir.actions.act_window">
|
||||
<field name="name">表面工艺</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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="mrs_materials_model" model="ir.actions.act_window">
|
||||
<field name="name">材料型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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="mrs_processing_technology" model="ir.actions.act_window">
|
||||
<field name="name">加工工艺</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.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="sf_product_template" model="ir.actions.act_window">
|
||||
<field name="name">产品</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="domain">[('materials_model_ids', '!=', False)]</field>
|
||||
<field name="res_model">product.template</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_product_account_purchase_ok_form" model="ir.ui.view">
|
||||
<field name="name">product.template.materials</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="account.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after" >
|
||||
<group>
|
||||
<field name="materials_model_ids" widget="many2many"/>
|
||||
</group>
|
||||
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_product_account_purchase_ok_search" model="ir.ui.view">
|
||||
<field name="name">product.template.materials.search</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="产品名">
|
||||
<field name="name" string="产品名查询"
|
||||
filter_domain = "[('name','ilike',self)]" />
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
1
sf_bf_connect/__init__.py
Normal file
1
sf_bf_connect/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*-coding:utf-8-*-
|
||||
4
sf_mrs_sync/__init__.py
Normal file
4
sf_mrs_sync/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import models
|
||||
|
||||
pengge
|
||||
27
sf_mrs_sync/__manifest__.py
Normal file
27
sf_mrs_sync/__manifest__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫藏智能工厂 同步模块',
|
||||
'version': '1.0',
|
||||
'summary': '智能工厂同步模块',
|
||||
'sequence': 1,
|
||||
'description': """
|
||||
在本模块,同步资源库
|
||||
""",
|
||||
'category': 'YZ',
|
||||
'website': 'https://www.sf.cs.jikimo.com',
|
||||
'depends': ['account', 'sf_base'],
|
||||
'data': [
|
||||
|
||||
'data/sf_cron.xml'
|
||||
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
1
sf_mrs_sync/connect/__init__.py
Normal file
1
sf_mrs_sync/connect/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*-coding:utf-8-*-
|
||||
13
sf_mrs_sync/data/sf_cron.xml
Normal file
13
sf_mrs_sync/data/sf_cron.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding='UTF-8'?>
|
||||
<odoo>
|
||||
<record model="ir.cron" id="sf_cron">
|
||||
<field name="name">同步资源库材料</field>
|
||||
<field name="model_id" ref="model_mrs_production_materials"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model.sync_production_materials()</field>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">minutes</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field name="doall" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
2
sf_mrs_sync/models/__init__.py
Normal file
2
sf_mrs_sync/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from. import sf_sync_common
|
||||
73
sf_mrs_sync/models/sf_sync_common.py
Normal file
73
sf_mrs_sync/models/sf_sync_common.py
Normal file
@@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import math
|
||||
import requests
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MrsProductionMaterials(models.Model):
|
||||
_inherit = "mrs.production.materials"
|
||||
_description = "材料"
|
||||
url = '/api/production_materials/list'
|
||||
|
||||
def sync_production_materials(self):
|
||||
str = '定时同步材料资源库'
|
||||
print(str)
|
||||
return str
|
||||
|
||||
|
||||
class MrsMaterialModel(models.Model):
|
||||
_inherit = 'mrs.materials.model'
|
||||
_description = '材料型号'
|
||||
|
||||
|
||||
class MrsProductionProcess(models.Model):
|
||||
_inherit = 'mrs.production.process'
|
||||
_description = '表面工艺'
|
||||
|
||||
|
||||
class MrsProcessingTechnology(models.Model):
|
||||
_inherit = 'mrs.processing.technology'
|
||||
_description = '加工工艺'
|
||||
|
||||
|
||||
class MachineBrandTags(models.Model):
|
||||
_inherit = 'mrs.machine.brand.tags'
|
||||
_description = '标签'
|
||||
|
||||
|
||||
class MachineControlSystem(models.Model):
|
||||
_inherit = 'mrs.machine_tool.type.control_system'
|
||||
_description = '控制系统'
|
||||
|
||||
|
||||
class MachineBrand(models.Model):
|
||||
_inherit = 'mrs.machine.brand'
|
||||
_description = '品牌'
|
||||
|
||||
|
||||
class MachineTool(models.Model):
|
||||
_inherit = 'mrs.machine_tool'
|
||||
_description = '机床'
|
||||
|
||||
|
||||
class MachineToolType(models.Model):
|
||||
_inherit = 'mrs.machine_tool.type'
|
||||
_description = '机床型号'
|
||||
|
||||
|
||||
class CuttingTool(models.Model):
|
||||
_inherit = 'mrs.cutting_tool.category'
|
||||
_description = '刀具类别'
|
||||
|
||||
|
||||
class CuttingToolType(models.Model):
|
||||
_inherit = 'mrs.cutting_tool.type'
|
||||
_description = '刀具型号'
|
||||
Reference in New Issue
Block a user