优化工件装夹
This commit is contained in:
4
sf_base/wizard/__init__.py
Normal file
4
sf_base/wizard/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import workpiece_clamping_wizard
|
||||
from . import stock_removal_wizard
|
||||
21
sf_base/wizard/stock_removal_wizard.py
Normal file
21
sf_base/wizard/stock_removal_wizard.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StockRemovalWizard(models.Model):
|
||||
_name = 'sf.stock.removal.wizard'
|
||||
_description = "出库"
|
||||
|
||||
code = fields.Char(string="功能夹具编码", size=25, required=True)
|
||||
name = fields.Char(string="功能夹具名称", size=25, required=True)
|
||||
type = fields.Char(string="功能夹具类型", required=True)
|
||||
production_line = fields.Char(string="生产线", required=True)
|
||||
machine_tool = fields.Many2one('sf.machine_tool', string="机床", required=True)
|
||||
|
||||
def submit(self):
|
||||
return 1
|
||||
|
||||
34
sf_base/wizard/stock_removal_wizard_view.xml
Normal file
34
sf_base/wizard/stock_removal_wizard_view.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="stock_removal_wizard_form_view">
|
||||
<field name="name">sf.stock.removal.wizard.form.view</field>
|
||||
<field name="model">sf.stock.removal.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="出库">
|
||||
<group>
|
||||
<group>
|
||||
<field name="code" string="编码"></field>
|
||||
<field name="type" string="类型"></field>
|
||||
<field name="machine_tool" string="类型"></field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" string="名称"></field>
|
||||
<field name="production_line" string="类型"></field>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="确定" name="submit" type="object" class="oe_highlight"/>
|
||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_stock_removal_wizard" model="ir.actions.act_window">
|
||||
<field name="name">出库</field>
|
||||
<field name="res_model">sf.stock.removal.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
56
sf_base/wizard/workpiece_clamping_wizard.py
Normal file
56
sf_base/wizard/workpiece_clamping_wizard.py
Normal file
@@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class WorkpieceClampingWizard(models.Model):
|
||||
_name = 'sf.workpiece.clamping.wizard'
|
||||
_description = "工件装夹"
|
||||
# 以下为坯料(工件)申请信息
|
||||
apply_code = fields.Char(string="申请坯料编码", size=25, required=True)
|
||||
apply_name = fields.Char(string="申请坯料名称", size=25, required=True)
|
||||
material_id = fields.Many2one('sf.production.materials', string="坯料材料", required=True)
|
||||
apply_width = fields.Float(string="申请宽度", required=True)
|
||||
apply_length = fields.Float(string="申请长度", required=True)
|
||||
apply_height = fields.Float(string="申请高度", required=True)
|
||||
apply_weight = fields.Float(string="申请重量", required=True)
|
||||
apply_diameter = fields.Float(string="申请直径", required=True)
|
||||
surface_accuracy = fields.Char(string="表面精度", required=True)
|
||||
# 以下为坯料(工件)装夹信息
|
||||
chuck_name = fields.Char(string="卡盘名称", required=True)
|
||||
chuck_brand_id = fields.Many2one('sf.machine.brand', string="卡盘品牌", required=True)
|
||||
chuck_type_id = fields.Char(string="卡盘类型", required=True)
|
||||
chuck_model_id = fields.Char(string="卡盘型号", required=True)
|
||||
tray_name = fields.Char(string="托盘名称", required=True)
|
||||
tray_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌", required=True)
|
||||
tray_type_id = fields.Char(string="托盘类型", required=True)
|
||||
tray_model_id = fields.Char(string="托盘型号", required=True)
|
||||
real_code = fields.Char(string="真实坯料编码", size=25, required=True)
|
||||
real_name = fields.Char(string="真实坯料名称", size=25, required=True)
|
||||
real_width = fields.Float(string="真实宽度", required=True)
|
||||
real_length = fields.Float(string="真实长度", required=True)
|
||||
real_height = fields.Float(string="真实高度", required=True)
|
||||
real_diameter = fields.Float(string="真实直径", required=True)
|
||||
# 以下为坯料(工件)预调信息
|
||||
# hole_site = fields.Char(string="孔位", required=True)
|
||||
# curve = fields.Char(string="曲线", required=True)
|
||||
# straight_line = fields.Char(string="直线", required=True)
|
||||
# x_axis = fields.Float(string="X轴", required=True)
|
||||
# y_axis = fields.Float(string="Y轴", required=True)
|
||||
# z_axis = fields.Float(string="Z轴", required=True)
|
||||
# tool_radius = fields.Float(string="刀具半径", required=True)
|
||||
# tool_length = fields.Float(string="刀具长度", required=True)
|
||||
# tool_offset_point = fields.Float(string="刀具偏移点", required=True)
|
||||
# tool_compensation_value = fields.Float(string="刀具补偿值", required=True)
|
||||
# cutting_spindle_speed = fields.Float(string="切削主轴转速", required=True)
|
||||
# cutting_feed_rate = fields.Float(string="切削进给速度", required=True)
|
||||
# depth_of_cutting = fields.Float(string="切削深度", required=True)
|
||||
# cutting_direction = fields.Char(string="切削方向", required=True)
|
||||
preset_program_information = fields.Char(string="预调程序信息", required=True)
|
||||
|
||||
def submit(self):
|
||||
return 1
|
||||
83
sf_base/wizard/workpiece_clamping_wizard_view.xml
Normal file
83
sf_base/wizard/workpiece_clamping_wizard_view.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="workpiece_clamping_wizard_form_view">
|
||||
<field name="name">sf.workpiece.clamping.wizard.form.view</field>
|
||||
<field name="model">sf.workpiece.clamping.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="装夹">
|
||||
<group string="坯料(工件)申请信息">
|
||||
<group>
|
||||
<field name="apply_code" string="编码"></field>
|
||||
<field name="material_id" string="材质"></field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="apply_name" string="名称"></field>
|
||||
<label for="apply_length" string="尺寸[mm]"/>
|
||||
<div class="o_address_format">
|
||||
<label for="apply_length" string="长"/>
|
||||
<field name="apply_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="apply_width" string="宽"/>
|
||||
<field name="apply_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="apply_height" string="高"/>
|
||||
<field name="apply_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="apply_diameter" string="直径"></field>
|
||||
</group>
|
||||
</group>
|
||||
<group string="坯料(工件)装夹信息">
|
||||
<group string="卡盘">
|
||||
<field name="chuck_type_id"></field>
|
||||
<field name="chuck_name"></field>
|
||||
<field name="chuck_brand_id"></field>
|
||||
<field name="chuck_model_id"></field>
|
||||
</group>
|
||||
<group string="托盘">
|
||||
<field name="tray_type_id"></field>
|
||||
<field name="tray_name"></field>
|
||||
<field name="tray_brand_id"></field>
|
||||
<field name="tray_model_id"></field>
|
||||
</group>
|
||||
<group string="坯料">
|
||||
<field name="real_code"></field>
|
||||
<field name="real_name"></field>
|
||||
<label for="real_length" string="尺寸[mm]"/>
|
||||
<div class="o_address_format">
|
||||
<label for="real_length" string="长"/>
|
||||
<field name="real_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="real_width" string="宽"/>
|
||||
<field name="real_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="real_height" string="高"/>
|
||||
<field name="real_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="real_diameter" string="直径"></field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="preset_program_information"></field>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="确定" name="submit" type="object" class="oe_highlight"/>
|
||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_workpiece_clamping_wizard" model="ir.actions.act_window">
|
||||
<field name="name">装夹</field>
|
||||
<field name="res_model">sf.workpiece.clamping.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user