Accept Merge Request #896: (feature/优化agv接口 -> develop)
Merge Request: 优化agv接口和修复刀具产品模版 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/896
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import requests
|
||||
from datetime import date
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
|
||||
class CuttingToolMaterial(models.Model):
|
||||
@@ -113,6 +110,24 @@ class CuttingToolModel(models.Model):
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz(整体式刀具)')
|
||||
feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz(刀片)')
|
||||
material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _get_code(self):
|
||||
if self.is_cloud is False:
|
||||
today = date.today().strftime("%Y%m%d")
|
||||
today_code = 'T-DJWL-%s-%s' % (self.cutting_tool_material_id.code, today)
|
||||
cutting_tool_model = self.search(
|
||||
[('code', 'ilike', today_code), ('is_cloud', '=', False),
|
||||
('active', 'in', [True, False])],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not cutting_tool_model:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(today_code[-3:]) + 1
|
||||
num = "%03d" % m
|
||||
self.code = "%s%s" % (today_code, num)
|
||||
|
||||
# 适用夹头型号可以多选
|
||||
# chuck_ids = fields.Many2many(
|
||||
# 'sf.cutting_tool.standard.library',
|
||||
|
||||
@@ -10,6 +10,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具标准库')
|
||||
cutting_tool_type = fields.Char(related='standard_library_id.cutting_tool_type', string='刀具物料类型',
|
||||
store=True)
|
||||
is_cloud = fields.Boolean(related='standard_library_id.is_cloud', string='云端数据')
|
||||
|
||||
# 整体式刀具参数
|
||||
total_length = fields.Float('总长度(mm)')
|
||||
@@ -21,7 +22,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
handle_diameter = fields.Float('柄部直径(mm)')
|
||||
handle_length = fields.Float('柄部长度(mm)')
|
||||
blade_tip_diameter = fields.Integer('刀尖直径(mm)')
|
||||
blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
||||
blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角度)', size=20)
|
||||
blade_tip_taper = fields.Integer('刀尖锥度(°)')
|
||||
blade_diameter = fields.Float('刃部直径(mm)')
|
||||
blade_length = fields.Float('刃部长度(mm)')
|
||||
@@ -37,7 +38,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
cutting_blade_length = fields.Float('切削刃长(mm)')
|
||||
relief_angle = fields.Integer('后角(°)')
|
||||
blade_tip_circular_arc_radius = fields.Char('刀尖圆弧半径(mm)', size=20)
|
||||
inscribed_circle_diameter = fields.Float('内接圆直径(mm)')
|
||||
inscribed_circle_diameter = fields.Float('内接圆直径IC/D(mm)')
|
||||
install_aperture_diameter = fields.Float('安装孔直径(mm)')
|
||||
chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||
string='有无断屑槽')
|
||||
@@ -170,8 +171,6 @@ class FeedPerTooth(models.Model):
|
||||
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)', size=20)
|
||||
active = fields.Boolean(string='有效', default=True)
|
||||
|
||||
|
||||
|
||||
# @api.depends('product_template_id')
|
||||
# def _compute_product_template_id(self):
|
||||
# if self.product_template_id is not None:
|
||||
|
||||
@@ -72,11 +72,15 @@ access_sf_cutting_speed_group_purchase_director,sf_cutting_speed_group_purchase_
|
||||
access_sf_cutting_speed_group_sale_director,sf_cutting_speed_group_sale_director,model_sf_cutting_speed,sf_base.group_sale_director,1,1,1,0
|
||||
access_sf_cutting_speed_group_plan_dispatch,sf_cutting_speed_group_plan_dispatch,model_sf_cutting_speed,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_cutting_speed_group_plan_director,sf_cutting_speed_group_plan_director,model_sf_cutting_speed,sf_base.group_plan_director,1,1,1,0
|
||||
access_sf_cutting_speed_group_quality_director,sf_cutting_speed_group_quality_director,model_sf_cutting_speed,sf_base.group_quality_director,1,1,1,0
|
||||
access_sf_cutting_speed_group_quality,sf_cutting_speed_group_quality,model_sf_cutting_speed,sf_base.group_quality,1,1,1,0
|
||||
access_sf_feed_per_tooth_group_purchase_director,sf_feed_per_tooth_group_purchase_director,model_sf_feed_per_tooth,sf_base.group_purchase_director,1,1,0,0
|
||||
access_sf_feed_per_tooth_group_sale_director,sf_feed_per_tooth_group_sale_director,model_sf_feed_per_tooth,sf_base.group_sale_director,1,1,0,0
|
||||
access_sf_feed_per_tooth_group_plan_dispatch,sf_feed_per_tooth_group_plan_dispatch,model_sf_feed_per_tooth,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_feed_per_tooth_group_plan_director,sf_feed_per_tooth_group_plan_director,model_sf_feed_per_tooth,sf_base.group_plan_director,1,1,0,0
|
||||
access_sf_feed_per_tooth_group_sale_salemanager,sf_feed_per_tooth_group_sale_salemanager,model_sf_feed_per_tooth,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_sf_feed_per_tooth_group_quality,sf_feed_per_tooth_group_quality,model_sf_feed_per_tooth,sf_base.group_quality,1,1,1,0
|
||||
access_sf_feed_per_tooth_group_quality_director,sf_feed_per_tooth_group_quality_director,model_sf_feed_per_tooth,sf_base.group_quality_director,1,1,1,0
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,0
|
||||
access_sf_feed_per_tooth_admin,sf_feed_per_tooth_admin,model_sf_feed_per_tooth,base.group_system,1,1,1,0
|
||||
access_sf_ramping_angle,sf_ramping_angle,model_sf_ramping_angle,base.group_user,1,1,1,1
|
||||
@@ -138,9 +142,7 @@ access_sf_cutting_width_depth,sf_cutting_width_depth,model_sf_cutting_width_dept
|
||||
access_sf_cutting_width_depth_group_purchase,sf_cutting_width_depth_group_purchase,model_sf_cutting_width_depth,sf_base.group_purchase,1,0,0,0
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_purchase_order_group_purchase,access_purchase_order_group_purchase,purchase.model_purchase_order,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_group_purchase_director,access_purchase_order_group_purchase_director,purchase.model_purchase_order,sf_base.group_purchase_director,1,1,1,0
|
||||
access_purchase_order_line_group_purchase,access_purchase_order_line_group_purchase,purchase.model_purchase_order_line,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_line_group_purchase_director,access_purchase_order_line_group_purchase_director,purchase.model_purchase_order_line,sf_base.group_purchase_director,1,1,1,0
|
||||
access_spindle_taper_type,spindle_taper_type,model_spindle_taper_type,base.group_user,1,1,1,1
|
||||
access_sf_tool_groups_group_plan_dispatch,sf_tool_groups,model_sf_tool_groups,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_tool_groups_group_sf_tool_user,sf_tool_groups,model_sf_tool_groups,sf_base.group_sf_tool_user,1,1,1,1
|
||||
|
||||
|
@@ -1,132 +1,302 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- ================================================刀具基础参数================================================ -->
|
||||
<record id="view_sf_tool_materials_basic_parameters_integral_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0" edit="0" sample="1">
|
||||
<field name="total_length" />
|
||||
<field name="blade_number" />
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter" />
|
||||
<field name="handle_length" />
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper" />
|
||||
<field name="blade_diameter" />
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width" />
|
||||
<field name="blade_width" />
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- ================================================刀具基础参数================================================ -->
|
||||
<record id="view_sf_tool_materials_basic_parameters_integral_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0" edit="0" sample="1">
|
||||
<field name="total_length"/>
|
||||
<field name="blade_number"/>
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter"/>
|
||||
<field name="handle_length"/>
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_blade_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length" />
|
||||
<field name="length" />
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length" />
|
||||
<field name="relief_angle" />
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter"/>
|
||||
<field name="install_aperture_diameter" />
|
||||
<field name="chip_breaker_groove" />
|
||||
<field name="blade_teeth_model"/>
|
||||
<field name="blade_blade_number"/>
|
||||
<field name="main_included_angle" />
|
||||
<field name="top_angle" />
|
||||
<field name="thread_model"/>
|
||||
<field name="thread_num" />
|
||||
<field name="blade_tip_height_tolerance" />
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_sf_tool_materials_basic_parameters_blade_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length"/>
|
||||
<field name="length"/>
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle"/>
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter"/>
|
||||
<field name="install_aperture_diameter"/>
|
||||
<field name="chip_breaker_groove"/>
|
||||
<field name="blade_teeth_model"/>
|
||||
<field name="blade_blade_number"/>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="top_angle"/>
|
||||
<field name="thread_model"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="blade_tip_height_tolerance"/>
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_cutter_bar_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length" />
|
||||
<field name="height" />
|
||||
<field name="blade_height"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="cutter_arbor_diameter" />
|
||||
<field name="min_machining_aperture" />
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole" />
|
||||
<field name="locating_slot_code" />
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id"/>
|
||||
<field name="tool_shim" />
|
||||
<field name="cotter_pin" />
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length"/>
|
||||
<field name="height"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="cutter_arbor_diameter"/>
|
||||
<field name="min_machining_aperture"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" >
|
||||
<field name="total_length" />
|
||||
<field name="blade_number" />
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter" />
|
||||
<field name="handle_length" />
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper" />
|
||||
<field name="blade_diameter" />
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width" />
|
||||
<field name="blade_width" />
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数">
|
||||
<field name="total_length"/>
|
||||
<field name="blade_number"/>
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter"/>
|
||||
<field name="handle_length"/>
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_sf_tool_materials_basic_parameters_search">
|
||||
<field name="name">sf.tool.materials.basic.parameters.search</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_sf_tool_materials_basic_parameters_search">
|
||||
<field name="name">sf.tool.materials.basic.parameters.search</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_tool_materials_basic_parameters" model="ir.actions.act_window">
|
||||
<field name="name">基础参数</field>
|
||||
<field name="res_model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<record id="view_sf_tool_materials_basic_parameters_form" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.form</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="规则">
|
||||
<sheet>
|
||||
<field name="cutting_tool_type" invisible="0"/>
|
||||
<field name="standard_library_id" invisible="1"/>
|
||||
<group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<field name="total_length"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_number"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="neck_diameter" class="diameter"/>
|
||||
<field name="handle_diameter" class="diameter"/>
|
||||
<field name="handle_length"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_diameter" class="diameter"/>
|
||||
<field name="blade_tip_taper"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="pitch"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_depth"/>
|
||||
<field name="cut_depth_max"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<field name="length"/>
|
||||
<field name="thickness"/>
|
||||
<field name="inscribed_circle_diameter" class="diameter"/>
|
||||
<field name="install_aperture_diameter" class="diameter" string="安装孔直径D1(mm)"/>
|
||||
<field name="blade_tip_circular_arc_radius" string="刀尖圆弧半径RE(mm)"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle"/>
|
||||
<field name="chip_breaker_groove"/>
|
||||
<field name="chip_breaker_type_code"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<field name="blade_teeth_model"/>
|
||||
<field name="thread_model"/>
|
||||
<field name="pitch"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="blade_blade_number" string="刃数"/>
|
||||
<field name="blade_width" string="刃宽"/>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="top_angle"/>
|
||||
<field name="blade_tip_height_tolerance"/>
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<field name="total_length"/>
|
||||
<field name="width"/>
|
||||
<field name="height"/>
|
||||
<label for="knife_head_length" string="刀头尺寸"/>
|
||||
<div class="test_model">
|
||||
<label for="knife_head_length" string="长"/>
|
||||
<field name="knife_head_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="knife_head_width" string="宽"/>
|
||||
<field name="knife_head_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="knife_head_height" string="高"/>
|
||||
<field name="knife_head_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_arbor_diameter" class="diameter"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<field name="main_included_angle"/>
|
||||
<field name="relief_angle"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="min_machining_aperture"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id" options="{'no_create': True}"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</group>
|
||||
|
||||
<!-- <field name="context">{'selection_mode': 'single'}</field>-->
|
||||
<field name="domain">[]</field>
|
||||
<!-- <field name="multi">false</field>-->
|
||||
</record>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}">
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_head_diameter" class="diameter"/>
|
||||
<field name="interface_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="cut_depth_max"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}">
|
||||
<field name="main_included_angle"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id" options="{'no_create': True}"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
</group>
|
||||
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}">
|
||||
<field name="er_size_model" string="尺寸型号"/>
|
||||
<label for="min_clamping_diameter" string="夹持直径"/>
|
||||
<div class="test_model">
|
||||
<label for="min_clamping_diameter" string="最小"/>
|
||||
<field name="min_clamping_diameter" class="o_address_zip diameter"
|
||||
options="{'format': false}"/>
|
||||
<label for="max_clamping_diameter" string="最大"/>
|
||||
<field name="max_clamping_diameter" class="o_address_zip diameter"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="total_length"/>
|
||||
<field name="outer_diameter" class="diameter"/>
|
||||
<field name="inner_diameter" class="diameter"/>
|
||||
<field name="taper"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}">
|
||||
<field name="run_out_accuracy"/>
|
||||
<field name="top_diameter" class="diameter"/>
|
||||
<field name="weight"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="cooling_jacket"/>
|
||||
</group>
|
||||
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}">
|
||||
<field name="taper_shank_model"/>
|
||||
<field name="total_length"/>
|
||||
<field name="shank_length"/>
|
||||
<field name="shank_diameter" class="diameter"/>
|
||||
<field name="flange_shank_length"/>
|
||||
<field name="flange_diameter" class="diameter"/>
|
||||
<field name="diameter_slip_accuracy"/>
|
||||
<field name="dynamic_balance_class"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}">
|
||||
<label for="min_clamping_diameter" string="夹持直径"/>
|
||||
<div class="test_model">
|
||||
<label for="min_clamping_diameter" string="最小"/>
|
||||
<field name="min_clamping_diameter" class="o_address_zip diameter"
|
||||
options="{'format': false}"/>
|
||||
<label for="max_clamping_diameter" string="最大"/>
|
||||
<field name="max_clamping_diameter" class="o_address_zip diameter"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="max_rotate_speed"/>
|
||||
<field name="fit_chuck_size"/>
|
||||
<field name="nut"/>
|
||||
<field name="spanner"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="tool_changing_time"/>
|
||||
<field name="cooling_model"/>
|
||||
<field name="is_quick_cutting"/>
|
||||
<field name="is_safe_lock"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_tool_materials_basic_parameters" model="ir.actions.act_window">
|
||||
<field name="name">基础参数</field>
|
||||
<field name="res_model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{'default_cutting_tool_type': cutting_tool_type}</field>
|
||||
<field name="domain">[]</field>
|
||||
<!-- <field name="multi">false</field>-->
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<field name="name">刀具标准库</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting_tool.standard.library</field>
|
||||
<!-- <field name="context">{'default_cutting_tool_material_id': cutting_tool_material_id}</field>-->
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 功能刀具action -->
|
||||
|
||||
@@ -123,19 +123,19 @@
|
||||
<form string="刀具标准库" delete="0" create="0" edit="0">
|
||||
<sheet>
|
||||
<field name="image" widget='image' class="oe_avatar"
|
||||
options="{'zoom': true, 'preview_image':'image_128'}"/>
|
||||
options="{'zoom': true, 'preview_image':'image_128'}" required="1"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code"/>
|
||||
<field name="code" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material_id"/>
|
||||
<field name="cutting_tool_type"/>
|
||||
<field name="cutting_tool_type_id"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="cutting_tool_material_id" readonly="1"/>
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="cutting_tool_type_id" required="1"/>
|
||||
<field name="brand_id" required="1"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<div class="o_address_format"
|
||||
@@ -165,8 +165,7 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="material_model_id" placeholder="请选择" string="材质"
|
||||
attrs="{'required': [('cutting_tool_type', 'not in', ['刀柄', '夹头'])]}"/>
|
||||
<field name="material_model_id" placeholder="请选择" string="材质"/>
|
||||
<field name="tool_hardness" string="硬度(hrc)" options="{'format': false}"
|
||||
widget="integer"/>
|
||||
<field name="coating_material"/>
|
||||
|
||||
@@ -32,9 +32,14 @@
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'required': [('categ_type', '=', '刀具')],'readonly': [('id', '!=', False)]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_model_id" placeholder="请选择" class="custom_required"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'required': [('categ_type', '=', '刀具')],'readonly': [('id', '!=', False)]}"/>
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"
|
||||
context="{'default_cutting_tool_material_id': cutting_tool_material_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'required': [('categ_type', '=', '刀具')],'readonly': [('id', '!=', False)]}">
|
||||
</field>
|
||||
<!-- <button name="%(sf_base.action_sf_cutting_tool_standard_library)d" string="新建" type="action"-->
|
||||
<!-- context="{'default_cutting_tool_material_id': cutting_tool_material_id}"/>-->
|
||||
<field name="specification_id" placeholder="请选择" class="custom_required"
|
||||
context="{'default_cutting_tool_type': cutting_tool_type,'default_standard_library_id':cutting_tool_model_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'required': [('categ_type', '=', '刀具')],'readonly': [('id', '!=', False)]}"
|
||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
@@ -90,7 +95,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||
<field name="name">product.template.only.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
@@ -104,7 +109,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||
<record model="ir.ui.view" id="view_product_template_only_dlm_form_inherit_sf">
|
||||
<field name="name">product.template.only.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sf_dlm_management.view_sale_product_template_form_inherit_sf"/>
|
||||
@@ -142,6 +147,10 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="tool_height"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_shank_length" string="刀柄长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_shank_diameter" string="刀柄直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_flange_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_flange_length"
|
||||
@@ -258,7 +267,7 @@
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_clamping_way"
|
||||
attrs="{'invisible': [('cutting_tool_type','not in',('刀柄','夹头'))],'readonly': [('id', '!=', False)]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type','not in',('刀柄'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_top_diameter" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type','not in',('夹头'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_outer_diameter" class="diameter"
|
||||
@@ -297,7 +306,7 @@
|
||||
<field name="tool_weight"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))],"readonly": [("id", "!=", False)]}'/>
|
||||
<field name="cutting_tool_taper"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))],'readonly': [('id', '!=', False)]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_taper_shank_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_dynamic_balance_class"
|
||||
@@ -340,9 +349,9 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_er_size_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_handle_id"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
|
||||
<!-- <field name="cutting_tool_handle_id"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>-->
|
||||
<field name="cooling_suit_type_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
|
||||
<!-- 刀杆 -->
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import controllers
|
||||
from . import workpiece
|
||||
|
||||
40
sf_manufacturing/controllers/workpiece.py
Normal file
40
sf_manufacturing/controllers/workpiece.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import json
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class Workpiece(http.Controller):
|
||||
|
||||
@http.route('/agvApi/backfeed', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def backfeed(self, **kw):
|
||||
"""
|
||||
agv小车反馈工单(工件)结果
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
logging.info('backfeed:%s' % kw)
|
||||
try:
|
||||
res = {'Succeed': True}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
logging.info('backfeed-ret:%s' % ret)
|
||||
if 'reqCode' in ret:
|
||||
if 'method' in ret:
|
||||
if ret['method'] == 'end':
|
||||
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
||||
[('production_id.name', '=', ret['reqCode'])])
|
||||
if workpiece_delivery:
|
||||
workpiece_delivery.write({'status': '已配送', 'task_completion_time': ret['reqTime']})
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '该reqCode暂未查到对应的工件配送记录'}
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 204, 'Error': '未传method字段'}
|
||||
else:
|
||||
res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传reqCode字段'}
|
||||
except Exception as e:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('backfeed error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
@@ -236,7 +236,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
# if not item.workpiece_code:
|
||||
# raise UserError('请对【同运工件】进行扫描')
|
||||
else:
|
||||
item.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
if item.status == '待下发':
|
||||
return {
|
||||
'name': _('确认'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sf.workpiece.delivery.wizard',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_workorder_id': self.id,
|
||||
}}
|
||||
|
||||
# 拼接工单对象属性值
|
||||
def json_workorder_str(self, k, production, route):
|
||||
@@ -899,7 +908,25 @@ class WorkPieceDelivery(models.Model):
|
||||
|
||||
# 配送至avg小车
|
||||
def _delivery_avg(self):
|
||||
self.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
res = {'reqCode': self.production_id.name, 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
||||
'taskTyp': 'F01', 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': '', 'positionCodePath': [], 'podCode': '',
|
||||
'podDir': '', 'materialLot': '', 'priority': '', 'taskCode': '', 'agvCode': '', 'materialLot': '',
|
||||
'data': ''}
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
try:
|
||||
logging.info('config-AGV请求路径:%s' % config['agv_rcms_url'])
|
||||
logging.info('config-json:%s' % res)
|
||||
ret = requests.post((config['agv_rcms_url']), json=res)
|
||||
ret = ret.json()
|
||||
logging.info('config-ret:%s' % ret)
|
||||
if ret['code'] == 0:
|
||||
if self.production_id.name == ret['reqCode']:
|
||||
self.write({'task_delivery_time': fields.Datetime.now(), 'status': '待配送'})
|
||||
else:
|
||||
raise UserError(ret['message'])
|
||||
except Exception as e:
|
||||
logging.info('config-e:%s' % e)
|
||||
raise UserError("工件配送请求agv失败")
|
||||
|
||||
@api.depends('production_id.production_line_id')
|
||||
def _compute_production_line_id(self):
|
||||
|
||||
@@ -6,6 +6,8 @@ import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
@@ -68,7 +70,8 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_shank_length = fields.Float('柄部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_blade_length = fields.Float('刃部长度(mm)')
|
||||
cutting_tool_blade_number = fields.Selection(
|
||||
[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')], '刃数(个)')
|
||||
[('0', '0'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')],
|
||||
string='刃数(个)', default='0')
|
||||
# 整体式刀具新增字段
|
||||
cutting_tool_neck_length = fields.Float('颈部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_neck_diameter = fields.Float('颈部直径(mm)', digits=(6, 1))
|
||||
@@ -101,6 +104,10 @@ class ResProductMo(models.Model):
|
||||
compaction_way_id = fields.Many2one('maintenance.equipment.image',
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])
|
||||
|
||||
@api.onchange('cutting_tool_model_id')
|
||||
def _onchange_cutting_tool_model_id(self):
|
||||
self.specification_id = False
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _onchange_cutting_tool_material_id(self):
|
||||
for item in self:
|
||||
@@ -190,20 +197,24 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_blade_number = self.specification_id.blade_number
|
||||
self.cutting_tool_blade_type = self.cutting_tool_model_id.blade_type
|
||||
self.cutting_tool_shank_diameter = self.specification_id.handle_diameter
|
||||
self.cutting_tool_shank_length = self.specification_id.handle_length
|
||||
self.cutting_tool_neck_length = self.specification_id.neck_length
|
||||
self.cutting_tool_neck_diameter = self.specification_id.neck_diameter
|
||||
self.cutting_tool_blade_tip_diameter = self.specification_id.blade_tip_diameter
|
||||
self.cutting_tool_blade_tip_taper = self.specification_id.blade_tip_taper
|
||||
self.cutting_tool_blade_helix_angle = self.specification_id.blade_helix_angle
|
||||
self.cutting_tool_blade_tip_working_size = self.specification_id.blade_tip_working_size
|
||||
self.cutting_tool_pitch = self.specification_id.pitch
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
self.cutting_tool_blade_depth = self.specification_id.blade_depth
|
||||
self.cutting_tool_cut_depth = self.specification_id.cutting_depth
|
||||
self.cutting_tool_cut_depth_max = self.specification_id.cut_depth_max
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||
lambda r: int(r.blade_diameter) == int(self.specification_id.blade_diameter))
|
||||
elif self.cutting_tool_type == '夹头':
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter
|
||||
self.cutting_tool_clamping_way = self.specification_id.clamping_mode
|
||||
self.cutting_tool_clamping_diameter_max = self.specification_id.max_clamping_diameter
|
||||
self.cutting_tool_taper = self.specification_id.taper
|
||||
self.cutting_tool_top_diameter = self.specification_id.top_diameter
|
||||
self.cutting_tool_outer_diameter = self.specification_id.outer_diameter
|
||||
self.cutting_tool_inner_diameter = self.specification_id.inner_diameter
|
||||
@@ -241,6 +252,7 @@ class ResProductMo(models.Model):
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids
|
||||
elif self.cutting_tool_type in ('刀盘', '刀杆'):
|
||||
self.cutting_tool_blade_diameter = self.specification_id.blade_diameter
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.tool_length = self.specification_id.length
|
||||
self.tool_thickness = self.specification_id.thickness
|
||||
@@ -271,14 +283,19 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_cutter_head_diameter = self.specification_id.cutter_head_diameter
|
||||
self.cutting_tool_interface_diameter = self.specification_id.interface_diameter
|
||||
else:
|
||||
self.cutting_tool_cutter_arbor_diameter = self.specification_id.cutter_arbor_diameter
|
||||
self.cutting_tool_knife_head_height = self.specification_id.knife_head_height
|
||||
self.cutting_tool_knife_head_width = self.specification_id.knife_head_width
|
||||
self.cutting_tool_knife_head_length = self.specification_id.knife_head_length
|
||||
self.cutting_tool_tool_shim = self.specification_id.tool_shim
|
||||
self.cutting_tool_cotter_pin = self.specification_id.cotter_pin
|
||||
self.cutting_tool_pressing_plate = self.specification_id.pressing_plate
|
||||
self.cutting_tool_min_machining_aperture = self.specification_id.min_machining_aperture
|
||||
self.cutting_tool_rear_angle = self.specification_id.relief_angle
|
||||
elif self.cutting_tool_type == '刀柄':
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_shank_diameter = self.specification_id.shank_diameter
|
||||
self.cutting_tool_shank_length = self.specification_id.shank_length
|
||||
self.cutting_tool_speed_max = self.specification_id.max_rotate_speed
|
||||
self.cutting_tool_change_time = self.specification_id.tool_changing_time
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
@@ -295,6 +312,8 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_chuck_id = self.specification_id.chuck_id.id
|
||||
self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy
|
||||
self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model
|
||||
self.cutting_tool_cooling_type = self.specification_id.cooling_model
|
||||
self.cutting_tool_clamping_way = self.specification_id.clamping_mode
|
||||
self.suitable_machining_method_ids = [(6, 0, [])] if not \
|
||||
self.cutting_tool_model_id.suitable_machining_method_ids \
|
||||
else [(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||
@@ -350,30 +369,30 @@ class ResProductMo(models.Model):
|
||||
self.cutting_speed_ids = False
|
||||
self.feed_per_tooth_ids = False
|
||||
|
||||
@api.constrains('fit_blade_shape_id', 'suitable_machining_method_ids', 'blade_tip_characteristics_id',
|
||||
'handle_type_id', 'cutting_direction_ids', 'suitable_coolant_ids', 'compaction_way_id')
|
||||
def _check_cutting_tool_ability(self):
|
||||
if self.cutting_tool_type in ['整体式刀具', '刀片', '刀杆', '刀盘']:
|
||||
if self.cutting_tool_type in ['刀片', '刀杆', '刀盘']:
|
||||
if not self.fit_blade_shape_id:
|
||||
raise ValidationError("请选择适配刀片形状")
|
||||
if self.cutting_tool_type in ['刀杆', '刀盘']:
|
||||
if not self.compaction_way_id:
|
||||
raise ValidationError("请选择压紧方式")
|
||||
if self.cutting_tool_type == '刀片':
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却方式")
|
||||
elif self.cutting_tool_type == '整体式刀具':
|
||||
if not self.handle_type_id:
|
||||
raise ValidationError("请选择柄部类型")
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却方式")
|
||||
if not self.suitable_machining_method_ids:
|
||||
raise ValidationError("请选择适合加工方式")
|
||||
if not self.blade_tip_characteristics_id:
|
||||
raise ValidationError("请选择刀尖特征")
|
||||
if not self.cutting_direction_ids:
|
||||
raise ValidationError("请选择走刀方向")
|
||||
# @api.constrains('fit_blade_shape_id', 'suitable_machining_method_ids', 'blade_tip_characteristics_id',
|
||||
# 'handle_type_id', 'cutting_direction_ids', 'suitable_coolant_ids', 'compaction_way_id')
|
||||
# def _check_cutting_tool_ability(self):
|
||||
# if self.cutting_tool_type in ['整体式刀具', '刀片', '刀杆', '刀盘']:
|
||||
# if self.cutting_tool_type in ['刀片', '刀杆', '刀盘']:
|
||||
# if not self.fit_blade_shape_id:
|
||||
# raise ValidationError("请选择适配刀片形状")
|
||||
# if self.cutting_tool_type in ['刀杆', '刀盘']:
|
||||
# if not self.compaction_way_id:
|
||||
# raise ValidationError("请选择压紧方式")
|
||||
# if self.cutting_tool_type == '刀片':
|
||||
# if not self.suitable_coolant_ids:
|
||||
# raise ValidationError("请选择适合冷却方式")
|
||||
# elif self.cutting_tool_type == '整体式刀具':
|
||||
# if not self.handle_type_id:
|
||||
# raise ValidationError("请选择柄部类型")
|
||||
# if not self.suitable_coolant_ids:
|
||||
# raise ValidationError("请选择适合冷却方式")
|
||||
# if not self.suitable_machining_method_ids:
|
||||
# raise ValidationError("请选择适合加工方式")
|
||||
# if not self.blade_tip_characteristics_id:
|
||||
# raise ValidationError("请选择刀尖特征")
|
||||
# if not self.cutting_direction_ids:
|
||||
# raise ValidationError("请选择走刀方向")
|
||||
|
||||
cutting_speed_ids = fields.One2many('sf.cutting.speed', 'product_template_id', string='切削速度Vc')
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'product_template_id', string='每齿走刀量fz')
|
||||
|
||||
@@ -542,7 +542,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="工件配送">
|
||||
<header>
|
||||
<button name="button_delivery" type="object" string="配送"/>
|
||||
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
||||
</header>
|
||||
<field name="status" widget="badge"
|
||||
decoration-success="status == '已配送'"
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="delivery_id" invisible="True"/>
|
||||
<field name="workorder_id" invisible="True"/>
|
||||
|
||||
<div>
|
||||
是否确定配送?
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,11 @@ class WorkpieceDeliveryWizard(models.TransientModel):
|
||||
_description = '工件配送'
|
||||
|
||||
delivery_id = fields.Many2one('sf.workpiece.delivery', string='配送')
|
||||
workorder_id = fields.Many2one('mrp.workorder', string='工单')
|
||||
|
||||
def confirm(self):
|
||||
self.delivery_id._delivery_avg()
|
||||
if self.workorder_id:
|
||||
self.workorder_id.workpiece_delivery_ids._delivery_avg()
|
||||
else:
|
||||
self.delivery_id._delivery_avg()
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ class ResConfigSettings(models.TransientModel):
|
||||
token = fields.Char(string='TOKEN', default='b811ac06-3f00-11ed-9aed-0242ac110003')
|
||||
sf_secret_key = fields.Char(string='密钥', default='wBmxej38OkErKhD6')
|
||||
sf_url = fields.Char(string='访问地址', default='https://sf.cs.jikimo.com')
|
||||
agv_url = fields.Char(string='avg访问地址', default='http://IP:PORT/rcms/services/rest')
|
||||
agv_rcms_url = fields.Char(string='avg_rcms访问地址',
|
||||
default='http://IP:PORT/rcms/services/rest/hikRpcService/genAgvSchedulingTask')
|
||||
agv_rcs_url = fields.Char(string='avg_rcs访问地址', default='http://IP:PORT/xxx/agv/agvCallbackService/agvCallback')
|
||||
model_parser_url = fields.Char('特征识别路径')
|
||||
ftp_host = fields.Char(string='FTP的ip')
|
||||
ftp_port = fields.Char(string='FTP端口')
|
||||
@@ -90,6 +92,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
token = config.get_param('token', default='')
|
||||
sf_secret_key = config.get_param('sf_secret_key', default='')
|
||||
sf_url = config.get_param('sf_url', default='')
|
||||
agv_rcms_url = config.get_param('agv_rcms_url', default='')
|
||||
agv_rcs_url = config.get_param('agv_rcs_url', default='')
|
||||
ftp_host = config.get_param('ftp_host', default='')
|
||||
ftp_port = config.get_param('ftp_port', default='')
|
||||
ftp_user = config.get_param('ftp_user', default='')
|
||||
@@ -99,6 +103,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
token=token,
|
||||
sf_secret_key=sf_secret_key,
|
||||
sf_url=sf_url,
|
||||
agv_rcms_url=agv_rcms_url,
|
||||
agv_rcs_url=agv_rcs_url,
|
||||
ftp_host=ftp_host,
|
||||
ftp_port=ftp_port,
|
||||
ftp_user=ftp_user,
|
||||
@@ -112,6 +118,8 @@ class ResConfigSettings(models.TransientModel):
|
||||
ir_config.set_param("token", self.token or "")
|
||||
ir_config.set_param("sf_secret_key", self.sf_secret_key or "")
|
||||
ir_config.set_param("sf_url", self.sf_url or "")
|
||||
ir_config.set_param("agv_rcms_url", self.agv_rcms_url or "")
|
||||
ir_config.set_param("agv_rcs_url", self.agv_rcs_url or "")
|
||||
ir_config.set_param("ftp_host", self.ftp_host or "")
|
||||
ir_config.set_param("ftp_port", self.ftp_port or "")
|
||||
ir_config.set_param("ftp_user", self.ftp_user or "")
|
||||
|
||||
@@ -74,9 +74,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>AGV参数配置</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane"/>
|
||||
<div class="o_setting_right_pane">
|
||||
<div class="text-muted">
|
||||
<label for="agv_rcms_url" string="调度系统(cms)访问地址"/>
|
||||
<field name="agv_rcms_url"/>
|
||||
</div>
|
||||
<div class="text-muted">
|
||||
<label for="agv_rcs_url" string="RCS-2000系统访问地址"/>
|
||||
<field name="agv_rcs_url"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
import base64
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class ReSaleOrder(models.Model):
|
||||
@@ -99,7 +99,7 @@ class ReSaleOrder(models.Model):
|
||||
def check_order_line(self):
|
||||
for item in self:
|
||||
if not item.order_line:
|
||||
raise UserError('请选择【订单行】中的【产品】')
|
||||
raise ValidationError('请选择【订单行】中的【产品】')
|
||||
for line in item.order_line:
|
||||
if not line.product_template_id:
|
||||
raise UserError('请对【订单行】中的【产品】进行选择')
|
||||
|
||||
@@ -243,6 +243,10 @@
|
||||
<form position="attributes">
|
||||
<attribute name="delete">False</attribute>
|
||||
</form>
|
||||
<field name="name" position="replace">
|
||||
<field name='name' placeholder="例如:奶酪汉堡" attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||
|
||||
</field>
|
||||
<field name="categ_id" position="replace">
|
||||
<field name='categ_id' invisible="1"/>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user