合并代码
This commit is contained in:
@@ -7,7 +7,7 @@ import math
|
|||||||
|
|
||||||
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models,SUPERUSER_ID
|
||||||
from pystrich.code128 import Code128Encoder
|
from pystrich.code128 import Code128Encoder
|
||||||
|
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ class MrpWorkOrder(models.Model):
|
|||||||
_inherit = 'mrp.workorder'
|
_inherit = 'mrp.workorder'
|
||||||
_description = '工单'
|
_description = '工单'
|
||||||
|
|
||||||
cnc_id = fields.Many2many('ir.attachment', 'cnc_attachment', string="cnc程序获取")
|
|
||||||
tray_ids = fields.One2many('sf.tray', 'workorder_id', string='托盘')
|
tray_ids = fields.One2many('sf.tray', 'workorder_id', string='托盘')
|
||||||
# def get_tray_info(self):
|
# def get_tray_info(self):
|
||||||
# @api.onchange('X_axis', 'Y_axis', 'Z_axis')
|
# @api.onchange('X_axis', 'Y_axis', 'Z_axis')
|
||||||
@@ -191,11 +191,21 @@ class MrpWorkOrder(models.Model):
|
|||||||
# }
|
# }
|
||||||
# )
|
# )
|
||||||
def recreateManufacturing(self):
|
def recreateManufacturing(self):
|
||||||
|
|
||||||
|
|
||||||
|
# productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(self.company_id).create(self.production_id)
|
||||||
|
# print(productions)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def recreateWorkerOrder(self):
|
def recreateWorkerOrder(self):
|
||||||
|
self.env['stock.move'].sudo().create(self.production_id._get_moves_raw_values())
|
||||||
|
self.env['stock.move'].sudo().create(self.production_id._get_moves_finished_values())
|
||||||
|
self.production_id._create_workorder()
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
cnc_id = fields.Many2many('ir.attachment', 'cnc_attachment', string="cnc程序获取")
|
||||||
|
def fetchCNC(self):
|
||||||
|
return ""
|
||||||
|
|
||||||
'''
|
'''
|
||||||
制造订单绑定托盘信息
|
制造订单绑定托盘信息
|
||||||
|
|||||||
@@ -8,9 +8,11 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//page[last()]" position="after">
|
<xpath expr="//page[last()]" position="after">
|
||||||
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
|
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
|
||||||
<group>
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
<field name="cnc_id" widget="many2many_binary"/>
|
<button type="object" class="oe_highlight" name="fetchCNC" string="获取CNC程序代码"
|
||||||
</group>
|
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
@@ -153,7 +155,25 @@
|
|||||||
<xpath expr="//page[last()]" position="after">
|
<xpath expr="//page[last()]" position="after">
|
||||||
<page string="CNC加工" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
<page string="CNC加工" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||||
<group>
|
<group>
|
||||||
<field name="cnc_ids" widget="one2many"/>
|
|
||||||
|
<field name="cnc_ids" widget="one2many">
|
||||||
|
<tree>
|
||||||
|
<field name="FNo" />
|
||||||
|
<field name="FPGName" />
|
||||||
|
<field name="FKnifeName" />
|
||||||
|
<field name="FDNo" />
|
||||||
|
<field name="FWorkType" />
|
||||||
|
<field name="FXY" />
|
||||||
|
<field name="FZ" />
|
||||||
|
<field name="FJGSD" />
|
||||||
|
<field name="FSCCD" />
|
||||||
|
<field name="FDJSpec" />
|
||||||
|
<field name="FJGDate" />
|
||||||
|
<field name="FComment" />
|
||||||
|
</tree>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
Reference in New Issue
Block a user