制造订单,产品,工单上进行3d模型展示
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['mrp', 'sf_base', 'maintenance'],
|
'depends': ['mrp', 'sf_base', 'maintenance', 'web_widget_model_viewer'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
string="检测结果")
|
string="检测结果")
|
||||||
cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工")
|
cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工")
|
||||||
tray_code = fields.Char(string="托盘")
|
tray_code = fields.Char(string="托盘")
|
||||||
|
glb_file = fields.Binary("glb模型文件")
|
||||||
|
|
||||||
# 计算配料中心点和与x轴倾斜度方法
|
# 计算配料中心点和与x轴倾斜度方法
|
||||||
def getcenter(self):
|
def getcenter(self):
|
||||||
|
|||||||
@@ -146,6 +146,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<field name="product_id" position="after">
|
||||||
|
<field name="model_file" string="产品模型" readonly="1" widget="Viewer3D"/>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,16 @@
|
|||||||
<field name="date_planned_finished" string="计划结束日期" optional="show"/>
|
<field name="date_planned_finished" string="计划结束日期" optional="show"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='button_start']" position="attributes">
|
<xpath expr="//button[@name='button_start']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', 'done',
|
<attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft',
|
||||||
|
'done',
|
||||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||||
('is_user_working', '!=', False),("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
('is_user_working', '!=', False),("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
||||||
</attribute>
|
</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}</attribute>
|
<attribute name="attrs">{'invisible':
|
||||||
|
['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
||||||
|
</attribute>
|
||||||
<attribute name="string">停工</attribute>
|
<attribute name="string">停工</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
||||||
@@ -133,7 +136,15 @@
|
|||||||
<field name="duration" widget="mrp_timer"
|
<field name="duration" widget="mrp_timer"
|
||||||
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
||||||
sum="real duration"/>
|
sum="real duration"/>
|
||||||
<field name="processing_panel" readonly="1" attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
<field name="processing_panel" readonly="1"
|
||||||
|
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||||
|
</group>
|
||||||
|
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
|
||||||
|
<div>
|
||||||
|
<label for="glb_file" string="加工模型"/>
|
||||||
|
<field name="glb_file" readonly="1" widget="Viewer3D"/>
|
||||||
|
</div>
|
||||||
|
<!-- <field name="glb_file" string="模型" readonly="1" widget="Viewer3D"/>-->
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',-->
|
<!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',-->
|
||||||
@@ -168,7 +179,8 @@
|
|||||||
<field name="tray_id" readonly="1"/>
|
<field name="tray_id" readonly="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="pro_code" readonly="1" attrs='{"invisible": [("pro_code_ok","=",False)]}' style="color:green"/>
|
<field name="pro_code" readonly="1" attrs='{"invisible": [("pro_code_ok","=",False)]}'
|
||||||
|
style="color:green"/>
|
||||||
<field name="pro_code" readonly="1" attrs='{"invisible": [("pro_code_ok","!=",False)]}'/>
|
<field name="pro_code" readonly="1" attrs='{"invisible": [("pro_code_ok","!=",False)]}'/>
|
||||||
<div>
|
<div>
|
||||||
<field name="pro_code_ok" invisible="1"/>
|
<field name="pro_code_ok" invisible="1"/>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class Sf_Mrs_Connect(http.Controller):
|
|||||||
('routing_type', '=', '获取CNC加工程序'),
|
('routing_type', '=', '获取CNC加工程序'),
|
||||||
('state', '=', 'progress')])
|
('state', '=', 'progress')])
|
||||||
if cnc_workorder:
|
if cnc_workorder:
|
||||||
|
cnc_workorder.glb_file = base64.b64encode(ret['glb_file'])
|
||||||
# 拉取所有加工面的程序文件
|
# 拉取所有加工面的程序文件
|
||||||
# i = 1
|
# i = 1
|
||||||
for r in ret['processing_panel']:
|
for r in ret['processing_panel']:
|
||||||
|
|||||||
Reference in New Issue
Block a user