Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
This commit is contained in:
@@ -398,11 +398,10 @@
|
||||
</group>
|
||||
</page>
|
||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘"))]}'>
|
||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘","零点托盘"))]}'>
|
||||
<group>
|
||||
<field name="brand_id"/>
|
||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"
|
||||
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"/>
|
||||
<label for="tool_length" string="尺寸(mm)"/>
|
||||
<div class="o_address_format">
|
||||
<label for="tool_length" string="长"/>
|
||||
@@ -419,9 +418,9 @@
|
||||
</div>
|
||||
<field name="tool_weight"></field>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="夹持工件最大尺寸(mm)"
|
||||
attrs='{"invisible": [("fixture_material_type","=",("零点卡盘"))]}'/>
|
||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("fixture_material_type","=",("零点卡盘"))]}'>
|
||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="长"/>
|
||||
<field name="fixture_clamp_workpiece_length_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
@@ -438,7 +437,7 @@
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动托盘','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
</div>
|
||||
<field name="fixture_clamp_workpiece_diameter_max"
|
||||
attrs="{'invisible': [('fixture_material_type','=','零点卡盘')],'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
attrs="{'invisible': [('fixture_material_type','in',('零点卡盘','零点托盘'))],'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<field name="fixture_maximum_carrying_weight"></field>
|
||||
<field name="fixture_maximum_clamping_force"></field>
|
||||
</group>
|
||||
@@ -453,10 +452,10 @@
|
||||
<field name="fixture_screw_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_driving_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘"))]}'/>
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘","零点托盘"))]}'/>
|
||||
<field name="fixture_apply_machine_tool_type_ids" options="{'no_create': True}"
|
||||
widget="many2many_tags"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("零点卡盘"))]}'/>
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("零点卡盘","零点托盘"))]}'/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
|
||||
@@ -83,16 +83,17 @@ class QuickEasyOrder(models.Model):
|
||||
|
||||
obj = super(QuickEasyOrder, self).create(vals)
|
||||
# self.model_coloring(obj)
|
||||
logging.info('---------开始派单到工厂-------')
|
||||
self.distribute_to_factory(obj)
|
||||
obj.state = '待接单'
|
||||
return obj
|
||||
|
||||
# 将attach的datas内容转为glb文件
|
||||
def transition_glb_file(self, report_path, model_code):
|
||||
# output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||
shapes = read_step_file(report_path)
|
||||
output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
# output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||
output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
||||
@@ -130,7 +131,7 @@ class QuickEasyOrder(models.Model):
|
||||
item.model_height = boxshape[2] # 高
|
||||
item.model_volume = boxshape[0] * boxshape[1] * boxshape[2]
|
||||
item.model_feature = json.dumps(ret['feature_infos'], ensure_ascii=False)
|
||||
# self._get_price(item)
|
||||
self._get_price(item)
|
||||
else:
|
||||
item.model_file = False
|
||||
item.model_feature = False
|
||||
@@ -145,6 +146,7 @@ class QuickEasyOrder(models.Model):
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
logging.info('---------派单到工厂-------')
|
||||
res = {'bfm_process_order_list': []}
|
||||
for item in obj:
|
||||
attachment = item.upload_model_file[0]
|
||||
@@ -181,10 +183,11 @@ class QuickEasyOrder(models.Model):
|
||||
company_id = self.env.ref('base.main_company').sudo()
|
||||
# user_id = request.env.ref('base.user_admin').sudo()
|
||||
order_id = self.env['sale.order'].sale_order_create(company_id, 'XXXXX', 'XXXXX', 'XXXXX',
|
||||
str(datetime.now()))
|
||||
str(datetime.now()), '现结', '支付宝')
|
||||
i = 1
|
||||
# 给sale_order的default_code字段赋值
|
||||
aa = self.env['sale.order'].sudo().search([('name', '=', order_id.name)])
|
||||
logging.info('---------aa------- %s' % aa.name)
|
||||
aa.default_code = obj.name
|
||||
for item in res['bfm_process_order_list']:
|
||||
product = self.env['product.template'].sudo().product_create(product_id, item, order_id,
|
||||
@@ -237,11 +240,10 @@ class QuickEasyOrder(models.Model):
|
||||
product_bom_purchase.bom_create_line_has(purchase_embryo)
|
||||
order_id.with_user(self.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
||||
except Exception as e:
|
||||
self.cr.rollback()
|
||||
# self.cr.rollback()
|
||||
return UserError('工厂创建销售订单和产品失败,请联系管理员')
|
||||
|
||||
|
||||
# 特征识别
|
||||
# 特征识别
|
||||
def feature_recognition(self, report_path, model_code):
|
||||
feature_path = self.env['sf.auto_quatotion.common'].sudo().get_feature_full_path()
|
||||
process_time_db_path = self.env['sf.auto_quatotion.common'].sudo().get_process_time_db_path()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from odoo import models, fields
|
||||
import datetime
|
||||
import base64
|
||||
import logging
|
||||
|
||||
|
||||
class ReSaleOrder(models.Model):
|
||||
@@ -16,6 +17,7 @@ class ReSaleOrder(models.Model):
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单
|
||||
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
||||
deadline_of_delivery, payments_way, pay_way):
|
||||
logging.info('---------sale_order_create------')
|
||||
now_time = datetime.datetime.now()
|
||||
partner = self.get_customer()
|
||||
order_id = self.env['sale.order'].sudo().create({
|
||||
|
||||
@@ -1101,6 +1101,8 @@
|
||||
<field name="functional_tool_diameter"/>
|
||||
<field name="functional_tool_length"/>
|
||||
<field name="functional_tool_cutting_type"/>
|
||||
<!-- <field name="barcode"/>-->
|
||||
<!-- <field name="barcode_image"/>-->
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -1125,78 +1127,58 @@
|
||||
</group>
|
||||
<group>
|
||||
<group col="1">
|
||||
<group col="1" attrs="{'invisible': [('integral_code_id', '=', False)]}">
|
||||
<div>
|
||||
<separator string="整体式刀具:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="integral_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="integral_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_integral_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_1" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group col="1">
|
||||
<group col="1" attrs="{'invisible': [('blade_code_id', '=', False)]}">
|
||||
<div>
|
||||
<separator string="刀片:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="blade_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="blade_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_blade_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_2" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1">
|
||||
<div>
|
||||
<separator string="刀柄:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="handle_code_id" string="序列号" placeholder="请选择"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
<field name="handle_code_id" string="序列号" placeholder="请选择"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="handle_name" string="名称"/>
|
||||
<field name="cutting_tool_cutterhandle_model_id" string="型号"/>
|
||||
<field name="sf_tool_brand_id_5" string="品牌"/>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="handle_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_cutterhandle_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_5" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('integral_code_id', '=', False)]}">
|
||||
<div>
|
||||
<separator string="整体式刀具:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<field name="integral_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="integral_name" string="名称"/>
|
||||
<field name="cutting_tool_integral_model_id" string="型号"/>
|
||||
<field name="sf_tool_brand_id_1" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('blade_code_id', '=', False)]}">
|
||||
<div>
|
||||
<separator string="刀片:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<field name="blade_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="blade_name" string="名称"/>
|
||||
<field name="cutting_tool_blade_model_id" string="型号"/>
|
||||
<field name="sf_tool_brand_id_2" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1">
|
||||
<group col="1">
|
||||
<div>
|
||||
<separator string="夹头:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="chuck_code_id" string="序列号" placeholder="请选择"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="chuck_name" string="名称"/>
|
||||
<field name="cutting_tool_cutterhead_model_id" string="型号"/>
|
||||
<field name="sf_tool_brand_id_6" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('bar_code_id', '=', False)]}">
|
||||
<div>
|
||||
<separator string="刀杆:" style="font-size: 13px;"/>
|
||||
@@ -1205,17 +1187,9 @@
|
||||
<group>
|
||||
<field name="bar_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="bar_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_cutterbar_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_3" string="品牌"/>
|
||||
<field name="sf_tool_brand_id_3" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
@@ -1227,43 +1201,14 @@
|
||||
<group>
|
||||
<field name="pad_code_id" placeholder="请选择" string="序列号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="pad_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_cutterpad_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_4" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1">
|
||||
<div>
|
||||
<separator string="夹头:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="chuck_code_id" string="序列号" placeholder="请选择"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="chuck_name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutting_tool_cutterhead_model_id" string="型号"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="sf_tool_brand_id_6" string="品牌"/>
|
||||
<field name="sf_tool_brand_id_4" string="品牌"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- <group>-->
|
||||
<!-- <field name="integral_code_id"/>-->
|
||||
<!-- <field name="cutting_tool_integral_model_id"/>-->
|
||||
|
||||
Reference in New Issue
Block a user