注册机床
This commit is contained in:
@@ -1,3 +1,2 @@
|
|||||||
|
|
||||||
from. import sf_base
|
from. import sf_base
|
||||||
from. import sf_common
|
from. import sf_common
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
<record model="ir.module.category" id="module_category_employee">
|
||||||
|
<field name="name">员工</field>
|
||||||
|
<field name="sequence">1</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.module.category" id="module_category_manage">
|
||||||
|
<field name="name">管理</field>
|
||||||
|
<field name="sequence">2</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <!– 系统管理相关 –>-->
|
||||||
|
<!-- <record id="group_master_data_manager" model="res.groups">-->
|
||||||
|
<!-- <field name="name">基础设置</field>-->
|
||||||
|
<!-- <field name="category_id" ref="base.module_category_employee"/>-->
|
||||||
|
<!-- <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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_processing_order,mrs_processing_order,model_mrs_processing_order,base.group_user,1,0,0,0
|
access_mrs_processing_order,mrs_processing_order,model_mrs_processing_order,base.group_user,1,1,1,1
|
||||||
access_mrs_production_process,mrs_production_process,model_mrs_production_process,base.group_user,1,0,0,0
|
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,0,0,0
|
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,0,0,0
|
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,0,0,0
|
access_mrs_processing_technology,mrs_processing_technology,model_mrs_processing_technology,base.group_user,1,1,1,1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -2,35 +2,43 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<!-- <menuitem action="mrp_production_action"-->
|
<!-- <menuitem action="mrp_production_action"-->
|
||||||
<!-- id="menu_mrp_production_action"-->
|
<!-- id="menu_mrp_production_action"-->
|
||||||
<!-- parent="menu_mrp_manufacturing"-->
|
<!-- parent="menu_mrp_manufacturing"-->
|
||||||
<!-- sequence="1"/>-->
|
<!-- sequence="1"/>-->
|
||||||
<!-- name="Manufacturing-->
|
<!-- name="Manufacturing-->
|
||||||
<!-- menu_mrp_configuration-->
|
<!-- menu_mrp_configuration-->
|
||||||
<!--parent="menu_mrp_configuration"-->
|
<!--parent="menu_mrp_configuration"-->
|
||||||
<!-- <menuitem id="menu_mrp_config"
|
<!-- <menuitem id="menu_mrp_config"
|
||||||
name="Settings"
|
name="Settings"
|
||||||
parent="menu_mrp_configuration"
|
parent="menu_mrp_configuration"
|
||||||
sequence="0"
|
sequence="0"
|
||||||
action="action_mrp_configuration"
|
action="action_mrp_configuration"
|
||||||
groups="base.group_system"/>-->
|
groups="base.group_system"/>-->
|
||||||
<menuitem
|
<menuitem
|
||||||
sequence="0"
|
id="menu_mrs_machine_tool"
|
||||||
name="基础数据"
|
parent="mrp.menu_mrp_configuration"
|
||||||
id="menu_mrs_base"
|
name="机床注册"
|
||||||
action="mrs_production_materials"
|
sequence="0"
|
||||||
parent="mrp.menu_mrp_configuration"
|
action="action_mrs_machine_tool"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
sequence="0"
|
||||||
|
name="基础数据"
|
||||||
|
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"
|
||||||
name="原材料"
|
name="原材料"
|
||||||
parent="menu_mrs_base"
|
parent="mrp.menu_mrp_configuration"
|
||||||
sequence="1"
|
sequence="0"
|
||||||
action="mrs_production_materials"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_sf_product_template"
|
id="menu_sf_product_template"
|
||||||
name="产品"
|
name="产品"
|
||||||
parent="menu_mrs_base"
|
parent="menu_mrs_base"
|
||||||
@@ -41,10 +49,8 @@ groups="base.group_system"/>-->
|
|||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_process_1"
|
id="menu_mrs_production_process_1"
|
||||||
name="工艺"
|
name="工艺"
|
||||||
parent="menu_mrs_base"
|
parent="mrp.menu_mrp_configuration"
|
||||||
sequence="1"
|
sequence="0"
|
||||||
action="mrs_production_process"
|
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -53,10 +59,8 @@ groups="base.group_system"/>-->
|
|||||||
id="menu_mrs_production_process"
|
id="menu_mrs_production_process"
|
||||||
name="表面工艺"
|
name="表面工艺"
|
||||||
parent="menu_mrs_production_process_1"
|
parent="menu_mrs_production_process_1"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="mrs_production_process"
|
action="mrs_production_process"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +68,7 @@ groups="base.group_system"/>-->
|
|||||||
id="menu_mrs_production_materials"
|
id="menu_mrs_production_materials"
|
||||||
name="材料"
|
name="材料"
|
||||||
parent="menu_mrs_production_materials_1"
|
parent="menu_mrs_production_materials_1"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="mrs_production_materials"
|
action="mrs_production_materials"
|
||||||
|
|
||||||
|
|
||||||
@@ -73,7 +77,7 @@ groups="base.group_system"/>-->
|
|||||||
id="menu_mrs_materials_model"
|
id="menu_mrs_materials_model"
|
||||||
name="材料型号"
|
name="材料型号"
|
||||||
parent="menu_mrs_production_materials_1"
|
parent="menu_mrs_production_materials_1"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="mrs_materials_model"
|
action="mrs_materials_model"
|
||||||
|
|
||||||
|
|
||||||
@@ -84,13 +88,10 @@ groups="base.group_system"/>-->
|
|||||||
id="menu_mrs_processing_technology"
|
id="menu_mrs_processing_technology"
|
||||||
name="加工工艺"
|
name="加工工艺"
|
||||||
parent="menu_mrs_production_process_1"
|
parent="menu_mrs_production_process_1"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="mrs_processing_technology"/>
|
action="mrs_processing_technology"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_machine_brand"
|
id="menu_mrs_machine_brand"
|
||||||
parent="menu_mrs_base"
|
parent="menu_mrs_base"
|
||||||
@@ -107,27 +108,24 @@ groups="base.group_system"/>-->
|
|||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool"
|
id="menu_mrs_cutting_tool"
|
||||||
parent="menu_mrs_base"
|
parent="mrp.menu_mrp_configuration"
|
||||||
name="刀具"
|
name="刀具"
|
||||||
sequence="1"/>
|
sequence="0"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool_category"
|
id="menu_mrs_cutting_tool_category"
|
||||||
parent="menu_mrs_cutting_tool"
|
parent="menu_mrs_cutting_tool"
|
||||||
name="刀具类别"
|
name="刀具类别"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="action_mrs_cutting_tool_category"/>
|
action="action_mrs_cutting_tool_category"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool_type"
|
id="menu_mrs_cutting_tool_type"
|
||||||
parent="menu_mrs_cutting_tool"
|
parent="menu_mrs_cutting_tool"
|
||||||
name="刀具型号"
|
name="刀具型号"
|
||||||
sequence="2"
|
sequence="1"
|
||||||
action="action_mrs_cutting_tool_type"/>
|
action="action_mrs_cutting_tool_type"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -312,4 +312,97 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
#------------------机床注册------------------
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="search_mrs_machine_tool_view">
|
||||||
|
<field name="name">search.mrs.machine_tool</field>
|
||||||
|
<field name="model">mrs.machine_tool</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_view">
|
||||||
|
<field name="name">tree.mrs.machine_tool</field>
|
||||||
|
<field name="model">mrs.machine_tool</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">
|
||||||
|
<field name="name">form.mrs.machine_tool</field>
|
||||||
|
<field name="model">mrs.machine_tool</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" model="ir.actions.act_window">
|
||||||
|
<field name="name">机床注册</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">mrs.machine_tool</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>
|
</odoo>
|
||||||
@@ -1,3 +1 @@
|
|||||||
# -*-coding:utf-8-*-
|
# -*-coding:utf-8-*-
|
||||||
from . import models
|
|
||||||
from . import controllers
|
|
||||||
|
|||||||
@@ -80,10 +80,10 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron8">
|
<record model="ir.cron" id="sf_cron8">
|
||||||
<field name="name">同步资源库机床</field>
|
<field name="name">同步注册机床</field>
|
||||||
<field name="model_id" ref="model_mrs_machine_tool"/>
|
<field name="model_id" ref="model_mrs_machine_tool"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_machine_tool()</field>
|
<field name="code">model.enroll_machine_tool()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
<field name="interval_type">days</field>
|
<field name="interval_type">days</field>
|
||||||
<field name="numbercall">-1</field>
|
<field name="numbercall">-1</field>
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
self.env['mrs.machine.brand.tags'].sync_all_machine_brand_tags()
|
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_tool.type.control_system'].sync_all_machine_tool_type_control_system()
|
||||||
self.env['mrs.machine.brand'].sync_all_machine_brand()
|
self.env['mrs.machine.brand'].sync_all_machine_brand()
|
||||||
self.env['mrs.machine_tool'].sync_all_machine_tool()
|
# self.env['mrs.machine_tool'].sync_all_machine_tool()
|
||||||
self.env['mrs.machine_tool.type'].sync_all_machine_tool_type()
|
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.category'].sync_all_cutting_tool_category()
|
||||||
self.env['mrs.cutting_tool.type'].sync_all_cutting_tool_type()
|
self.env['mrs.cutting_tool.type'].sync_all_cutting_tool_type()
|
||||||
|
return _logger.info("同步资源库成功")
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_values(self):
|
def get_values(self):
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ from odoo import models
|
|||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
import logging
|
import logging
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
|
|
||||||
|
from odoo.http import request
|
||||||
from .res_config_setting import ResConfigSettings
|
from .res_config_setting import ResConfigSettings
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -18,7 +20,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']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
||||||
@@ -35,11 +37,11 @@ class MrsProductionMaterials(models.Model):
|
|||||||
brand = self.env['mrs.production.materials'].search(
|
brand = self.env['mrs.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_no'])])
|
[("materials_no", '=', item['materials_no'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id=item['id'],
|
brand.id = item['id'],
|
||||||
brand.name= item['name'],
|
brand.name = item['name'],
|
||||||
brand.materials_no= item['materials_no'],
|
brand.materials_no = item['materials_no'],
|
||||||
brand.remark= item['remark'],
|
brand.remark = item['remark'],
|
||||||
brand.active= item['active']
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.production.materials'].create({
|
self.env['mrs.production.materials'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
@@ -491,6 +493,49 @@ class MachineTool(models.Model):
|
|||||||
_inherit = 'mrs.machine_tool'
|
_inherit = 'mrs.machine_tool'
|
||||||
_description = '机床'
|
_description = '机床'
|
||||||
url = '/api/machine_tool/list'
|
url = '/api/machine_tool/list'
|
||||||
|
crea_url = '/api/machine_tool/create'
|
||||||
|
|
||||||
|
# 注册同步机床
|
||||||
|
def enroll_machine_tool(self):
|
||||||
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
|
token = sf_sync_config['token']
|
||||||
|
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
||||||
|
headers = Common.get_headers(self, token, mrs_secret_key)
|
||||||
|
strurl = sf_sync_config['mrs_url'] + self.crea_url
|
||||||
|
objs_all = request.env['mrs.machine_tool'].sudo().search([])
|
||||||
|
machine_tool_list = []
|
||||||
|
if objs_all:
|
||||||
|
for item in objs_all:
|
||||||
|
val = {
|
||||||
|
'id': item.id,
|
||||||
|
'name': item.name,
|
||||||
|
'code': item.code,
|
||||||
|
'precision': item.precision,
|
||||||
|
'knife_type': item.knife_type,
|
||||||
|
'registration_date': str(item.registration_date),
|
||||||
|
'number_of_knife_library': item.number_of_knife_library,
|
||||||
|
'rotate_speed': item.rotate_speed,
|
||||||
|
'number_of_axles': item.number_of_axles,
|
||||||
|
'control_system_id': item.control_system_id.id,
|
||||||
|
# 'type_id': item.type_id.id,
|
||||||
|
# 'brand_id': item.brand_id.id,
|
||||||
|
'factory_id': item.factory_id.id,
|
||||||
|
'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 = json.dumps(machine_tool_list, ensure_ascii=False)
|
||||||
|
print(type(kw))
|
||||||
|
r = requests.post(strurl, json=kw, data=None, headers=headers)
|
||||||
|
print(r)
|
||||||
|
else:
|
||||||
|
raise _logger.info("没有注册机床")
|
||||||
|
|
||||||
# 定时同步机床
|
# 定时同步机床
|
||||||
def sync_machine_tool(self):
|
def sync_machine_tool(self):
|
||||||
@@ -816,7 +861,7 @@ class CuttingToolType(models.Model):
|
|||||||
else:
|
else:
|
||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
|
|
||||||
# 同步所有刀具型号
|
# 同步所有刀具型号
|
||||||
def sync_all_cutting_tool_type(self):
|
def sync_all_cutting_tool_type(self):
|
||||||
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']
|
||||||
|
|||||||
Reference in New Issue
Block a user