一键同步 代码优化 常量共享
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'YZ',
|
'category': 'YZ',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['account'],
|
'depends': ['account', 'base'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -80,47 +80,7 @@ class MachineTool(models.Model):
|
|||||||
|
|
||||||
active = fields.Boolean('有效', default=True)
|
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):
|
class MachineToolType(models.Model):
|
||||||
@@ -153,48 +113,15 @@ class MachineToolType(models.Model):
|
|||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
code = fields.Char('编码')
|
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):
|
class CuttingTool(models.Model):
|
||||||
_name = 'mrs.cutting_tool.category'
|
_name = 'mrs.cutting_tool.category'
|
||||||
_description = '刀具类别'
|
_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('编码')
|
code = fields.Char('编码')
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
# type_ids = fields.One2many('mrs.cutting_tool.type', 'category_id', string='刀具型号')
|
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
@@ -216,23 +143,3 @@ class CuttingToolType(models.Model):
|
|||||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
active = fields.Boolean('有效', default=True)
|
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
|
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ class MrsMaterialModel(models.Model):
|
|||||||
_description = '材料型号'
|
_description = '材料型号'
|
||||||
remark = fields.Text("备注")
|
remark = fields.Text("备注")
|
||||||
name = fields.Char('型号名')
|
name = fields.Char('型号名')
|
||||||
need_h = fields.Boolean("需要热处理", default="false")
|
need_h = fields.Boolean("热处理", default="false")
|
||||||
mf_materia_post = fields.Char("热处理后硬度")
|
mf_materia_post = fields.Char("热处理后密度")
|
||||||
density = fields.Float("密度(kg/m³)")
|
density = fields.Float("密度(kg/m³)")
|
||||||
materials_id = fields.Many2one('mrs.production.materials', "材料名")
|
materials_id = fields.Many2one('mrs.production.materials', "材料名")
|
||||||
materials_num = fields.Char("编码号")
|
materials_num = fields.Char("编码号")
|
||||||
material_no = fields.Char("编码")
|
materials_no = fields.Char("编码")
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -52,9 +52,10 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
remark = fields.Text('备注', index=True)
|
remark = fields.Text('备注', index=True)
|
||||||
process_encode = fields.Char("编码")
|
process_encode = fields.Char("编码")
|
||||||
processing_order_ids = fields.Many2many('mrs.processing.order', 'mrs_associated_processes',
|
processing_order_ids = fields.Many2many('mrs.processing.order', 'mrs_associated_processes',
|
||||||
index=True, string='工序')
|
index=True, string='工序')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
class MrsProcessingOrder(models.Model):
|
class MrsProcessingOrder(models.Model):
|
||||||
_name = 'mrs.processing.order'
|
_name = 'mrs.processing.order'
|
||||||
_description = '工序'
|
_description = '工序'
|
||||||
@@ -66,6 +67,7 @@ class MrsProcessingOrder(models.Model):
|
|||||||
|
|
||||||
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
|
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
|
||||||
|
|
||||||
|
|
||||||
class ProductTemplate(models.Model):
|
class ProductTemplate(models.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
_description = '产品'
|
_description = '产品'
|
||||||
|
|||||||
@@ -2,10 +2,25 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
<!-- <menuitem action="mrp_production_action"-->
|
||||||
<menuitem sequence="0"
|
<!-- 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
|
||||||
|
sequence="0"
|
||||||
name="基础数据"
|
name="基础数据"
|
||||||
id="menu_mrs_base"
|
id="menu_mrs_base"
|
||||||
|
action="mrs_production_materials"
|
||||||
|
parent="mrp.menu_mrp_configuration"
|
||||||
/>
|
/>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_materials_1"
|
id="menu_mrs_production_materials_1"
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<form string="材料型号">
|
<form string="材料型号">
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="material_no" readonly="1"/>
|
<field name="materials_no" readonly="1"/>
|
||||||
<field name="name" required="1"/>
|
<field name="name" required="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<field name="model">mrs.materials.model</field>
|
<field name="model">mrs.materials.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="材料型号">
|
<tree string="材料型号">
|
||||||
<field name="material_no"/>
|
<field name="materials_no"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="need_h"/>
|
<field name="need_h"/>
|
||||||
<field name="density"/>
|
<field name="density"/>
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
||||||
<field name="material_no" string="编码搜索" filter_domain="[('material_no','ilike',self)]"/>
|
<field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
|
||||||
<searchpanel class="account_root">
|
<searchpanel class="account_root">
|
||||||
<field name="materials_id" icon="fa-filter"/>
|
<field name="materials_id" icon="fa-filter"/>
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<field name="materials_model_ids" widget="ony2many">
|
<field name="materials_model_ids" widget="ony2many">
|
||||||
<tree string="材料型号">
|
<tree string="材料型号">
|
||||||
<field name="material_no"/>
|
<field name="materials_no"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="need_h"/>
|
<field name="need_h"/>
|
||||||
<field name="mf_materia_post"/>
|
<field name="mf_materia_post"/>
|
||||||
|
|||||||
@@ -14,6 +14,19 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
mrs_secret_key = fields.Char(string='密钥', default= 'wBmxej38OkErKhD6')
|
mrs_secret_key = fields.Char(string='密钥', default= 'wBmxej38OkErKhD6')
|
||||||
mrs_url = fields.Char(string='访问地址', default= 'https://mrs.cs.jikimo.com')
|
mrs_url = fields.Char(string='访问地址', default= 'https://mrs.cs.jikimo.com')
|
||||||
|
|
||||||
|
def sf_all_sync(self):
|
||||||
|
self.env['mrs.production.materials'].sync_all_production_materials()
|
||||||
|
self.env['mrs.materials.model'].sync_all_materials_model()
|
||||||
|
self.env['mrs.production.process'].sync_all_production_process()
|
||||||
|
self.env['mrs.processing.technology'].sync_all_processing_technology()
|
||||||
|
self.env['mrs.machine.brand.tags'].sync_all_machine_brand_tags()
|
||||||
|
self.env['mrs.machine_tool.type.control_system'].sync_all_machine_tool_type_control_system()
|
||||||
|
self.env['mrs.machine.brand'].sync_all_machine_brand()
|
||||||
|
self.env['mrs.machine_tool'].sync_all_machine_tool()
|
||||||
|
self.env['mrs.machine_tool.type'].sync_all_machine_tool_type()
|
||||||
|
self.env['mrs.cutting_tool.category'].sync_all_cutting_tool_category()
|
||||||
|
self.env['mrs.cutting_tool.type'].sync_all_cutting_tool_type()
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_values(self):
|
def get_values(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class MrsProductionMaterials(models.Model):
|
|||||||
|
|
||||||
# 定时同步每日材料
|
# 定时同步每日材料
|
||||||
def sync_production_materials(self):
|
def sync_production_materials(self):
|
||||||
|
|
||||||
#配置中获取token
|
#配置中获取token
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
@@ -52,6 +53,7 @@ class MrsProductionMaterials(models.Model):
|
|||||||
|
|
||||||
# 同步所有材料
|
# 同步所有材料
|
||||||
def sync_all_production_materials(self):
|
def sync_all_production_materials(self):
|
||||||
|
_logger = '正在同步所有材料'
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
||||||
@@ -102,7 +104,15 @@ class MrsMaterialModel(models.Model):
|
|||||||
brand = self.env['mrs.materials.model'].search(
|
brand = self.env['mrs.materials.model'].search(
|
||||||
[("materials_num", '=', item['materials_num'])])
|
[("materials_num", '=', item['materials_num'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.materials_no = item['materials_no'],
|
||||||
|
brand.remark = item['remark'],
|
||||||
|
brand.active = item['active'],
|
||||||
|
brand.mf_materia_post = item['mf_materia_post'],
|
||||||
|
brand.materials_id = item['materials_id'],
|
||||||
|
brand.need_h = item['need_h'],
|
||||||
|
brand.density = item['density']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.materials.model'].create({
|
self.env['mrs.materials.model'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -172,7 +182,12 @@ class MrsProductionProcess(models.Model):
|
|||||||
brand = self.env['mrs.production.process'].search(
|
brand = self.env['mrs.production.process'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.process_encode = item['process_encode'],
|
||||||
|
brand.remark = item['remark'],
|
||||||
|
brand.active = item['active'],
|
||||||
|
brand.remark = item['remark']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.production.process'].create({
|
self.env['mrs.production.process'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -235,7 +250,11 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
brand = self.env['mrs.processing.technology'].search(
|
brand = self.env['mrs.processing.technology'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.process_encode = item['process_encode'],
|
||||||
|
brand.remark = item['remark'],
|
||||||
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.processing.technology'].create({
|
self.env['mrs.processing.technology'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -297,7 +316,9 @@ class MachineBrandTags(models.Model):
|
|||||||
brand = self.env['mrs.machine.brand.tags'].search(
|
brand = self.env['mrs.machine.brand.tags'].search(
|
||||||
[("id", '=', item['id'])])
|
[("id", '=', item['id'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.color = item['color']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine.brand.tags'].create({
|
self.env['mrs.machine.brand.tags'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -353,7 +374,10 @@ class MachineControlSystem(models.Model):
|
|||||||
brand = self.env['mrs.machine_tool.type.control_system'].search(
|
brand = self.env['mrs.machine_tool.type.control_system'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine_tool.type.control_system'].create({
|
self.env['mrs.machine_tool.type.control_system'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -419,7 +443,10 @@ class MachineBrand(models.Model):
|
|||||||
brand = self.env['mrs.machine.brand'].search(
|
brand = self.env['mrs.machine.brand'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine.brand'].create({
|
self.env['mrs.machine.brand'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -477,11 +504,31 @@ class MachineTool(models.Model):
|
|||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_tool_yesterday_list']:
|
for item in result['machine_tool_all_yesterday_list']:
|
||||||
brand = self.env['mrs.machine_tool'].search(
|
brand = self.env['mrs.machine_tool'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.precision = item['precision'],
|
||||||
|
|
||||||
|
brand.knife_type = item['knife_type'],
|
||||||
|
brand.registration_date = item['registration_date'],
|
||||||
|
brand.number_of_knife_library = item['number_of_knife_library'],
|
||||||
|
brand.rotate_speed = item['rotate_speed'],
|
||||||
|
brand.number_of_axles = item['number_of_axles'],
|
||||||
|
brand.control_system_id = item['control_system_id'],
|
||||||
|
brand.type_id = item['type_id'],
|
||||||
|
brand.brand_id = item['brand_id'],
|
||||||
|
brand.x_axis = item['x_axis'],
|
||||||
|
brand.y_axis = item['y_axis'],
|
||||||
|
brand.z_axis = item['z_axis'],
|
||||||
|
brand.b_axis = item['b_axis'],
|
||||||
|
brand.c_axis = item['c_axis'],
|
||||||
|
brand.state = item['state'],
|
||||||
|
brand.active = item['active']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine_tool'].create({
|
self.env['mrs.machine_tool'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -572,7 +619,24 @@ class MachineToolType(models.Model):
|
|||||||
brand = self.env['mrs.machine_tool.type'].search(
|
brand = self.env['mrs.machine_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.precision = item['precision'],
|
||||||
|
brand.number_of_knife_library = item['number_of_knife_library'],
|
||||||
|
brand.rotate_speed = item['rotate_speed'],
|
||||||
|
brand.number_of_axles = item['number_of_axles'],
|
||||||
|
brand.control_system_id = item['control_system_id'],
|
||||||
|
brand.brand_id = item['brand_id'],
|
||||||
|
brand.x_axis = item['x_axis'],
|
||||||
|
brand.y_axis = item['y_axis'],
|
||||||
|
brand.z_axis = item['z_axis'],
|
||||||
|
brand.b_axis = item['b_axis'],
|
||||||
|
brand.c_axis = item['c_axis'],
|
||||||
|
brand.active = item['active'],
|
||||||
|
brand.remark = item['remark'],
|
||||||
|
brand.machine_tool_id = item['machine_tool_id']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine_tool.type'].create({
|
self.env['mrs.machine_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -655,7 +719,11 @@ class CuttingTool(models.Model):
|
|||||||
brand = self.env['mrs.cutting_tool.category'].search(
|
brand = self.env['mrs.cutting_tool.category'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.active = item['active'],
|
||||||
|
brand.remark = item['remark']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.cutting_tool.category'].create({
|
self.env['mrs.cutting_tool.category'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -716,7 +784,18 @@ class CuttingToolType(models.Model):
|
|||||||
brand = self.env['mrs.cutting_tool.type'].search(
|
brand = self.env['mrs.cutting_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
print(item['name'])
|
brand.id = item['id'],
|
||||||
|
brand.name = item['name'],
|
||||||
|
brand.code = item['code'],
|
||||||
|
brand.active = item['active'],
|
||||||
|
brand.remark = item['remark'],
|
||||||
|
brand.diameter = item['diameter'],
|
||||||
|
brand.cone_angle_pitch = item['cone_angle_pitch'],
|
||||||
|
brand.shank_diameter = item['shank_diameter'],
|
||||||
|
brand.long_blade = item['long_blade'],
|
||||||
|
brand.taper_shank_length = item['taper_shank_length'],
|
||||||
|
brand.tool_length = item['tool_length'],
|
||||||
|
brand.blade_number = item['blade_number']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.cutting_tool.type'].create({
|
self.env['mrs.cutting_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" name="sf_all_sync" string="同步资源库所有基础数据"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user