Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/刀具产品调取Cloud刀具标准库(10.11)
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': ['web'],
|
'depends': ['web', 'purchase'],
|
||||||
'data': [
|
'data': [
|
||||||
|
|
||||||
],
|
],
|
||||||
@@ -28,6 +28,13 @@
|
|||||||
'jikimo_frontend/static/src/views/list_nums/list_nums2.xml',
|
'jikimo_frontend/static/src/views/list_nums/list_nums2.xml',
|
||||||
'jikimo_frontend/static/src/views/list_nums/list_nums3.xml',
|
'jikimo_frontend/static/src/views/list_nums/list_nums3.xml',
|
||||||
'jikimo_frontend/static/src/js/custom_form_status_indicator.js',
|
'jikimo_frontend/static/src/js/custom_form_status_indicator.js',
|
||||||
|
'jikimo_frontend/static/src/scss/rowno_in_tree.scss',
|
||||||
|
# 'jikimo_frontend/static/src/views/list_nums/list_render.xml',
|
||||||
|
'jikimo_frontend/static/src/list/list_up_down_button.xml',
|
||||||
|
'jikimo_frontend/static/src/list/custom_import.js',
|
||||||
|
'jikimo_frontend/static/src/list/custom_width.js',
|
||||||
|
'jikimo_frontend/static/src/views/list_nums/extent_purchase.xml',
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
84
jikimo_frontend/static/src/list/custom_width.js
Normal file
84
jikimo_frontend/static/src/list/custom_width.js
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/** @odoo-module */
|
||||||
|
|
||||||
|
import {patch} from '@web/core/utils/patch';
|
||||||
|
import {ListRenderer} from "@web/views/list/list_renderer"
|
||||||
|
|
||||||
|
// var {patch} = require("web.utils") 这句话也行
|
||||||
|
|
||||||
|
patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||||
|
// 你可以重写或者添加一些方法和属性
|
||||||
|
// The following code manipulates the DOM directly to avoid having to wait for a
|
||||||
|
// render + patch which would occur on the next frame and cause flickering.
|
||||||
|
freezeColumnWidths() {
|
||||||
|
console.log('ccccccccccccccccccccccccccc')
|
||||||
|
if (!this.keepColumnWidths) {
|
||||||
|
this.columnWidths = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const table = this.tableRef.el;
|
||||||
|
const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")];
|
||||||
|
const column_num = headers.length
|
||||||
|
|
||||||
|
if (!this.columnWidths || !this.columnWidths.length) {
|
||||||
|
// no column widths to restore
|
||||||
|
// Set table layout auto and remove inline style to make sure that css
|
||||||
|
// rules apply (e.g. fixed width of record selector)
|
||||||
|
table.style.tableLayout = "auto";
|
||||||
|
headers.forEach((th) => {
|
||||||
|
th.style.width = null;
|
||||||
|
th.style.maxWidth = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.setDefaultColumnWidths(column_num);
|
||||||
|
|
||||||
|
// Squeeze the table by applying a max-width on largest columns to
|
||||||
|
// ensure that it doesn't overflow
|
||||||
|
this.columnWidths = this.computeColumnWidthsFromContent();
|
||||||
|
table.style.tableLayout = "fixed";
|
||||||
|
}
|
||||||
|
headers.forEach((th, index) => {
|
||||||
|
if (!th.style.width) {
|
||||||
|
th.style.width = `${Math.floor(this.columnWidths[index])}px`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setDefaultColumnWidths(column_num) {
|
||||||
|
const bbb = this.state.columns[0].name
|
||||||
|
const widths = this.state.columns.map((col) => this.calculateColumnWidth(col));
|
||||||
|
const sumOfRelativeWidths = (widths
|
||||||
|
.filter(({ type }) => type === "relative")
|
||||||
|
.reduce((sum, { value }) => sum + value, 0));
|
||||||
|
|
||||||
|
// 获取数组的最后一项
|
||||||
|
const lastItem = widths[widths.length - 1];
|
||||||
|
|
||||||
|
// 复制最后一项
|
||||||
|
const newItem = { ...lastItem };
|
||||||
|
|
||||||
|
// 将新的对象添加到数组的末尾
|
||||||
|
widths.push(newItem);
|
||||||
|
|
||||||
|
// 判断销售的sequence
|
||||||
|
if (this.state.columns[0].name === "sequence") {
|
||||||
|
widths[1] = { type: "relative", value: 0.1 };
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1 because nth-child selectors are 1-indexed, 2 when the first column contains
|
||||||
|
// the checkboxes to select records.
|
||||||
|
const columnOffset = this.hasSelectors ? 2 : 1;
|
||||||
|
widths.forEach(({ type, value }, i) => {
|
||||||
|
const headerEl = this.tableRef.el.querySelector(`th:nth-child(${i + columnOffset})`);
|
||||||
|
if (type === "absolute") {
|
||||||
|
if (this.isEmpty) {
|
||||||
|
headerEl.style.width = value;
|
||||||
|
} else {
|
||||||
|
headerEl.style.minWidth = value;
|
||||||
|
}
|
||||||
|
} else if (type === "relative" && this.isEmpty) {
|
||||||
|
headerEl.style.width = `${((value / column_num) * 100).toFixed(2)}%`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
20
jikimo_frontend/static/src/list/list_up_down_button.xml
Normal file
20
jikimo_frontend/static/src/list/list_up_down_button.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<templates>
|
||||||
|
<t t-name="list_up_down_button" t-inherit="web.ListView.Buttons" t-inherit-mode="extension" owl="1">
|
||||||
|
<xpath expr="//t[@t-if='nbTotal and !nbSelected and activeActions.exportXlsx and isExportEnable and !env.isSmall']" position="before">
|
||||||
|
<!-- 新增的导入文件按钮 -->
|
||||||
|
<!-- <button type="button" class="btn btn-secondary fa fa-upload o_list_import_file" data-tooltip="导入文件" aria-label="Import File" title="" t-on-click="onDirectImportData"/> -->
|
||||||
|
<!-- <button type="button" class="btn btn-secondary fa fa-upload o_list_import_file" data-tooltip="导入文件" aria-label="Import File" title="" t-on-click="onDirectImportData"/> -->
|
||||||
|
<!-- <button type="button" class="btn btn-secondary fa fa-download o_list_export_xlsx" data-tooltip="导出全部" aria-label="导出全部" t-on-click="onDirectExportData"/> -->
|
||||||
|
<button type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导出全部" aria-label="导出全部" t-on-click="onDirectExportData">导出全部</button>
|
||||||
|
<!-- <button type="button" t-component="base_import.ImportRecords" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据" t-on-click="importRecords">导入数据</button> -->
|
||||||
|
<!-- <button type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据" t-on-click="importRecords">导入数据</button> -->
|
||||||
|
<!-- <t t-component="base_import.ImportRecords"> -->
|
||||||
|
<!-- <button t-on-click="importRecords" type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据">导入数据</button> -->
|
||||||
|
<!-- </t> -->
|
||||||
|
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-if='nbTotal and !nbSelected and activeActions.exportXlsx and isExportEnable and !env.isSmall']" position="replace">
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
</templates>
|
||||||
@@ -17,6 +17,7 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.my-image div {
|
.my-image div {
|
||||||
|
|
||||||
width: 110px !important;
|
width: 110px !important;
|
||||||
height: 110px !important;
|
height: 110px !important;
|
||||||
}
|
}
|
||||||
@@ -341,3 +342,15 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.o_form_view {
|
||||||
|
.o_form_sheet_bg .o_form_sheet {
|
||||||
|
//max-width: none !important;
|
||||||
|
width: auto !important;
|
||||||
|
max-width: 98% !important;
|
||||||
|
}
|
||||||
|
.o_FormRenderer_chatterContainer {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
jikimo_frontend/static/src/scss/rowno_in_tree.scss
Normal file
4
jikimo_frontend/static/src/scss/rowno_in_tree.scss
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.row_no {
|
||||||
|
width: 3.2% !important;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<templates>
|
||||||
|
<t t-name="purchase.PurchaseListView" t-inherit="web.ListRenderer" t-inherit-mode="primary" owl="1">
|
||||||
|
<xpath expr="//div[hasclass('o_list_renderer')]" position="before">
|
||||||
|
<PurchaseDashBoard />
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
</templates>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<t t-name="og.web.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension">
|
<t t-name="og.web.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension">
|
||||||
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
|
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
|
||||||
<th><i class="fa fa-list-ol"/></th>
|
<th class="row_no"><i class="fa fa-list-ol"/></th>
|
||||||
</xpath>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
|
|||||||
47
jikimo_frontend/static/src/views/list_nums/list_render.xml
Normal file
47
jikimo_frontend/static/src/views/list_nums/list_render.xml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<template>
|
||||||
|
<t
|
||||||
|
t-name="rowno_in_tree.ListRenderer"
|
||||||
|
t-inherit="web.ListRenderer"
|
||||||
|
t-inherit-mode="extension"
|
||||||
|
owl="1"
|
||||||
|
|
||||||
|
>
|
||||||
|
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
|
||||||
|
<th class="row_no"><i class="fa fa-list-ol"/></th>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//div/table/tfoot/tr/td" position="before">
|
||||||
|
<td />
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
<t
|
||||||
|
t-name="rowno_in_tree.add_number"
|
||||||
|
t-inherit="web.ListRenderer.Rows"
|
||||||
|
t-inherit-mode="extension"
|
||||||
|
owl="1"
|
||||||
|
>
|
||||||
|
<xpath expr="//t[@t-foreach='list.records']" position="before">
|
||||||
|
<t t-set="RowNumber" t-value="1" />
|
||||||
|
</xpath>
|
||||||
|
<xpath
|
||||||
|
expr="//t[@t-call='{{ constructor.recordRowTemplate }}']"
|
||||||
|
position="after"
|
||||||
|
>
|
||||||
|
<t t-set="RowNumber" t-value="RowNumber+1" />
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
<t
|
||||||
|
t-name="rowno_in_tree.ListRenderer.RecordRowNumber"
|
||||||
|
t-inherit="web.ListRenderer.RecordRow"
|
||||||
|
t-inherit-mode="extension"
|
||||||
|
owl="1"
|
||||||
|
>
|
||||||
|
<xpath expr="//td[@class='o_list_record_selector']" position="before">
|
||||||
|
<td tabindex="-1">
|
||||||
|
<span t-esc="RowNumber" />
|
||||||
|
</td>
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
</template>
|
||||||
@@ -30,6 +30,25 @@
|
|||||||
<field name="type">夹具</field>
|
<field name="type">夹具</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="product_category_functional_tool_sf" model="product.category">
|
||||||
|
<field name="name">功能刀具</field>
|
||||||
|
<field name="type">功能刀具</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="product_functional_tool_sf" model="product.product">
|
||||||
|
<field name="name">功能刀具</field>
|
||||||
|
<field name="categ_id" ref="product_category_functional_tool_sf"/>
|
||||||
|
<field name="route_ids"
|
||||||
|
eval="[ref('stock.route_warehouse0_mto')]"/>
|
||||||
|
<field name="invoice_policy">delivery</field>
|
||||||
|
<field name="detailed_type">product</field>
|
||||||
|
<field name="sale_ok">false</field>
|
||||||
|
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||||
|
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||||
|
<field name="company_id" ref="base.main_company"/>
|
||||||
|
<field name="tracking">serial</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="product_template_sf" model="product.product">
|
<record id="product_template_sf" model="product.product">
|
||||||
<field name="name">CNC加工产品模板</field>
|
<field name="name">CNC加工产品模板</field>
|
||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
|||||||
string='适用设备',
|
string='适用设备',
|
||||||
domain="[('category_id', '=', maintenance_equipment_category_id)]"
|
domain="[('category_id', '=', maintenance_equipment_category_id)]"
|
||||||
)
|
)
|
||||||
|
maintenance_standards_ids = fields.One2many('maintenance.standards', 'equipment_maintenance_standards_id',
|
||||||
maintenance_standards_ids = fields.One2many('maintenance.standards', 'equipment_maintenance_standards_id', string='维保项目')
|
string='维保项目', widget='one2many_list')
|
||||||
eq_maintenance_ids = fields.One2many('maintenance.equipment', 'eq_maintenance_id', string='保养设备')
|
eq_maintenance_ids = fields.One2many('maintenance.equipment', 'eq_maintenance_id', string='保养设备')
|
||||||
overhaul_ids = fields.One2many('maintenance.equipment', 'overhaul_id', string='检修设备')
|
overhaul_ids = fields.One2many('maintenance.equipment', 'overhaul_id', string='检修设备')
|
||||||
|
|
||||||
@@ -81,6 +81,7 @@ class SfSaintenanceStandards(models.Model):
|
|||||||
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='类别')
|
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='类别')
|
||||||
equipment_maintenance_standards_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准')
|
equipment_maintenance_standards_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准')
|
||||||
images = fields.One2many('maintenance.standard.image', 'standard_id', string='反馈图片')
|
images = fields.One2many('maintenance.standard.image', 'standard_id', string='反馈图片')
|
||||||
|
maintenance_request_ids = fields.Many2many('maintenance.request', string='维保计划')
|
||||||
Period = fields.Integer('周期/频次(天)')
|
Period = fields.Integer('周期/频次(天)')
|
||||||
remark = fields.Char('备注说明')
|
remark = fields.Char('备注说明')
|
||||||
|
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
item.brand_id = item.type_id.brand_id.id
|
item.brand_id = item.type_id.brand_id.id
|
||||||
|
|
||||||
# AGV小车设备参数
|
# AGV小车设备参数
|
||||||
AGV_L = fields.Char('设备尺寸(长)')
|
AGV_L = fields.Char('AGV尺寸(长)')
|
||||||
AGV_W = fields.Char('设备尺寸(宽)')
|
AGV_W = fields.Char('AGV尺寸(宽)')
|
||||||
AGV_H = fields.Char('设备尺寸(高)')
|
AGV_H = fields.Char('AGV尺寸(高)')
|
||||||
AGV_goods_L = fields.Char('载货尺寸(长)')
|
AGV_goods_L = fields.Char('载货尺寸(长)')
|
||||||
AGV_goods_W = fields.Char('载货尺寸(宽)')
|
AGV_goods_W = fields.Char('载货尺寸(宽)')
|
||||||
AGV_goods_H = fields.Char('载货尺寸(高)')
|
AGV_goods_H = fields.Char('载货尺寸(高)')
|
||||||
@@ -276,9 +276,9 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
detect_L = fields.Char('设备尺寸(长)')
|
detect_L = fields.Char('设备尺寸(长)')
|
||||||
detect_W = fields.Char('设备尺寸(宽)')
|
detect_W = fields.Char('设备尺寸(宽)')
|
||||||
detect_H = fields.Char('设备尺寸(高)')
|
detect_H = fields.Char('设备尺寸(高)')
|
||||||
detect_x_axis = fields.Char('X轴')
|
detect_x_axis = fields.Char('检测X轴')
|
||||||
detect_y_axis = fields.Char('Y轴')
|
detect_y_axis = fields.Char('检测Y轴')
|
||||||
detect_z_axis = fields.Char('Z轴')
|
detect_z_axis = fields.Char('检测Z轴')
|
||||||
detect_precision = fields.Char('测量精度')
|
detect_precision = fields.Char('测量精度')
|
||||||
detect_measurement_mode = fields.Selection([('光栅尺', '光栅尺'), ('容栅', '容栅'), ('磁栅', '磁栅'), ('激光干涉仪', '激光干涉仪')], string='测量方式')
|
detect_measurement_mode = fields.Selection([('光栅尺', '光栅尺'), ('容栅', '容栅'), ('磁栅', '磁栅'), ('激光干涉仪', '激光干涉仪')], string='测量方式')
|
||||||
detect_resolution = fields.Char('分辨率')
|
detect_resolution = fields.Char('分辨率')
|
||||||
@@ -295,8 +295,8 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
detect_object_field_of_view_max = fields.Char('物方视场(最大)')
|
detect_object_field_of_view_max = fields.Char('物方视场(最大)')
|
||||||
detect_object_field_of_view_min = fields.Char('物方视场(最小)')
|
detect_object_field_of_view_min = fields.Char('物方视场(最小)')
|
||||||
detect_power_requirements = fields.Char('电源要求')
|
detect_power_requirements = fields.Char('电源要求')
|
||||||
detect_operating_temperature = fields.Char('环境温度')
|
detect_operating_temperature = fields.Char('检测设备环境温度')
|
||||||
detect_operating_humidity = fields.Char('环境湿度')
|
detect_operating_humidity = fields.Char('检测设备环境湿度')
|
||||||
|
|
||||||
# 机器人设备参数
|
# 机器人设备参数
|
||||||
robot_gripping_of_workpieces_L = fields.Char('可抓取工件(长)')
|
robot_gripping_of_workpieces_L = fields.Char('可抓取工件(长)')
|
||||||
@@ -313,8 +313,8 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
robot_track_dimensions_H = fields.Char('轨道尺寸(高)')
|
robot_track_dimensions_H = fields.Char('轨道尺寸(高)')
|
||||||
robot_drive_mode = fields.Char('驱动方式')
|
robot_drive_mode = fields.Char('驱动方式')
|
||||||
robot_installation_method = fields.Selection([('置地式', '置地式'), ('壁挂式', '壁挂式'), ('倒挂式', '倒挂式')], string='安装方式')
|
robot_installation_method = fields.Selection([('置地式', '置地式'), ('壁挂式', '壁挂式'), ('倒挂式', '倒挂式')], string='安装方式')
|
||||||
robot_operating_temperature = fields.Char('环境温度')
|
robot_operating_temperature = fields.Char('机器人环境温度')
|
||||||
robot_operating_humidity = fields.Char('环境湿度')
|
robot_operating_humidity = fields.Char('机器人环境湿度')
|
||||||
|
|
||||||
# 其他参数(所有设备)
|
# 其他参数(所有设备)
|
||||||
date_of_purchase = fields.Date('采购日期')
|
date_of_purchase = fields.Date('采购日期')
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
|||||||
if not record.equipment_maintenance_id:
|
if not record.equipment_maintenance_id:
|
||||||
record.equipment_maintenance_id = False
|
record.equipment_maintenance_id = False
|
||||||
|
|
||||||
maintenance_standards = fields.Many2many('maintenance.standards', string='维保标准')
|
maintenance_standards = fields.Many2many('maintenance.standards', string='维保项目')
|
||||||
|
|
||||||
@api.constrains('equipment_maintenance_id')
|
@api.constrains('equipment_maintenance_id')
|
||||||
def _check_equipment_maintenance_id(self):
|
def _check_equipment_maintenance_id(self):
|
||||||
|
|||||||
@@ -1,5 +1,63 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
|
<!-- 维保项目表单视图-->
|
||||||
|
|
||||||
|
<record id="view_maintenance_standards_form" model="ir.ui.view">
|
||||||
|
<field name="name">maintenance.standards.form</field>
|
||||||
|
<field name="model">maintenance.standards</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="设备维保项目">
|
||||||
|
<sheet>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="maintenance_standards"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="remark"/>
|
||||||
|
<field name="maintenance_request_ids" invisible="1"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<notebook>
|
||||||
|
<page string="上传图片" autofocus="autofocus">
|
||||||
|
<field name="images" mode="kanban">
|
||||||
|
<kanban quick_create="1" create="1">
|
||||||
|
<field name="image"/>
|
||||||
|
<templates>
|
||||||
|
<t t-name="kanban-box">
|
||||||
|
<div class="oe_kanban_global_click">
|
||||||
|
<!-- 在这里定义每个卡片的内容 -->
|
||||||
|
<span>
|
||||||
|
<image>
|
||||||
|
<field name="image" preview_image="image_128" widget="image"/>
|
||||||
|
</image>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
</templates>
|
||||||
|
</kanban>
|
||||||
|
<form>
|
||||||
|
<sheet>
|
||||||
|
<field name="image" preview_image="image_128" widget="image"/>
|
||||||
|
<field name="standard_id"/>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
</notebook>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_view_maintenance_standards_tree" model="ir.actions.act_window">
|
||||||
|
<field name="name">Maintenance Standards</field>
|
||||||
|
<field name="res_model">maintenance.standards</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="view_id" ref="view_maintenance_standards_form"/>
|
||||||
|
</record>
|
||||||
<!-- equiment.request : actions -->
|
<!-- equiment.request : actions -->
|
||||||
|
|
||||||
<record model="ir.ui.view" id="sf_hr_equipment_request_view_form">
|
<record model="ir.ui.view" id="sf_hr_equipment_request_view_form">
|
||||||
@@ -21,17 +79,16 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
|
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}">
|
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}" context="{'default_standard_id': 'id'}">
|
||||||
<field name="maintenance_standards" widget="ony2many">
|
<field name="maintenance_standards" widget="one2many_list">
|
||||||
<tree>
|
<tree multi_edit="" editable="">
|
||||||
<field name="sequence"/>
|
<field name="name" />
|
||||||
<field name="name"/>
|
|
||||||
<field name="maintenance_standards"/>
|
<field name="maintenance_standards"/>
|
||||||
<field name="images"/>
|
<field name="images" force_save="1" required="1">
|
||||||
|
</field>
|
||||||
<field name="remark"/>
|
<field name="remark"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
|
|
||||||
@@ -71,40 +128,5 @@
|
|||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 维保项目表单视图-->
|
|
||||||
|
|
||||||
<record id="view_maintenance_standards_form" model="ir.ui.view">
|
|
||||||
<field name="name">maintenance.standards.form</field>
|
|
||||||
<field name="model">maintenance.standards</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<form string="设备维保项目">
|
|
||||||
<sheet>
|
|
||||||
<group>
|
|
||||||
<group>
|
|
||||||
<field name="sequence"/>
|
|
||||||
<field name="name"/>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<field name="maintenance_standards"/>
|
|
||||||
<field name="remark"/>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
|
|
||||||
</group>
|
|
||||||
<notebook>
|
|
||||||
<page string="上传图片">
|
|
||||||
<field name="images" widget="one2many">
|
|
||||||
<tree editable="bottom">
|
|
||||||
<field name="image" widget="image" options="{'size': [100, 100], 'click enlarge': True}"/>
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</page>
|
|
||||||
</notebook>
|
|
||||||
|
|
||||||
</sheet>
|
|
||||||
</form>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -22,6 +22,24 @@
|
|||||||
<field name="company_id" ref="base.main_company"/>
|
<field name="company_id" ref="base.main_company"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_location_locations_virtual_after_assembly" model="stock.location">
|
||||||
|
<field name="name">组装后</field>
|
||||||
|
<field name="location_id" ref="stock.stock_location_locations_virtual"/>
|
||||||
|
<field name="usage">internal</field>
|
||||||
|
<field name="barcode">DJ-ZZ</field>
|
||||||
|
<field name="active">true</field>
|
||||||
|
<field name="company_id" ref="base.main_company"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- <record id="stock_location_locations_WH_tool_stock_area" model="stock.location">-->
|
||||||
|
<!-- <field name="name">刀具存货区</field>-->
|
||||||
|
<!-- <field name="location_id" ref="stock.stock_location_locations_virtual"/>-->
|
||||||
|
<!-- <field name="usage">internal</field>-->
|
||||||
|
<!-- <field name="barcode">WH-DJCHQ</field>-->
|
||||||
|
<!-- <field name="active">true</field>-->
|
||||||
|
<!-- <field name="company_id" ref="base.main_company"/>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
<record id="outcontract_picking_in" model="stock.picking.type">
|
<record id="outcontract_picking_in" model="stock.picking.type">
|
||||||
<field name="name">外协入库</field>
|
<field name="name">外协入库</field>
|
||||||
<field name="code">internal</field>
|
<field name="code">internal</field>
|
||||||
@@ -46,6 +64,16 @@
|
|||||||
<field name="default_location_dest_id" ref="stock_location_locations_virtual_outcontract"/>
|
<field name="default_location_dest_id" ref="stock_location_locations_virtual_outcontract"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="after_assembly_picking_in" model="stock.picking.type">
|
||||||
|
<field name="name">刀具组装入库</field>
|
||||||
|
<field name="code">internal</field>
|
||||||
|
<field name="active">true</field>
|
||||||
|
<field name="company_id" ref="base.main_company"/>
|
||||||
|
<field name="sequence_code">ZR</field>
|
||||||
|
<field name="default_location_src_id" ref="stock_location_locations_virtual_after_assembly"/>
|
||||||
|
<field name="default_location_dest_id"
|
||||||
|
search="[('barcode','=','WH-PREPRODUCTION')]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class ResProductCategory(models.Model):
|
|||||||
|
|
||||||
type = fields.Selection(
|
type = fields.Selection(
|
||||||
[("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
[("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||||
("夹具", "夹具")],
|
("夹具", "夹具"), ("功能刀具", "功能刀具")],
|
||||||
default="", string="类型")
|
default="", string="类型")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ class sf_production_plan(models.Model):
|
|||||||
# picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type', compute='_compute_orderpoint_id')
|
# picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type', compute='_compute_orderpoint_id')
|
||||||
# move_dest_ids = fields.One2many('stock.move', 'created_production_id', compute='_compute_orderpoint_id')
|
# move_dest_ids = fields.One2many('stock.move', 'created_production_id', compute='_compute_orderpoint_id')
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def get_import_templates(self):
|
||||||
|
"""returns the xlsx import template file"""
|
||||||
|
return [{
|
||||||
|
'label': _('导入计划数据'),
|
||||||
|
'template': '/sf_plan/static/src/xlsx/sf_production_plan.xlsx'
|
||||||
|
}]
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _compute_orderpoint_id(self):
|
def _compute_orderpoint_id(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
BIN
sf_plan/static/src/xlsx/sf_production_plan.xlsx
Normal file
BIN
sf_plan/static/src/xlsx/sf_production_plan.xlsx
Normal file
Binary file not shown.
@@ -12,8 +12,10 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
_name = 'sf.functional.cutting.tool.entity'
|
_name = 'sf.functional.cutting.tool.entity'
|
||||||
_description = '功能刀具列表'
|
_description = '功能刀具列表'
|
||||||
|
|
||||||
code = fields.Char('编码')
|
# code = fields.Char('序列号')
|
||||||
name = fields.Char('名称', required=True, size=20)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
|
||||||
|
name = fields.Char(related='barcode_id.name')
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True)
|
||||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
||||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型',
|
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型',
|
||||||
group_expand='_read_group_mrs_cutting_tool_type_id', compute_sudo=True)
|
group_expand='_read_group_mrs_cutting_tool_type_id', compute_sudo=True)
|
||||||
@@ -93,53 +95,6 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
return [(6, 0, functional_tool_model_ids)]
|
return [(6, 0, functional_tool_model_ids)]
|
||||||
|
|
||||||
|
|
||||||
class FunctionalCuttingToolEntityCache(models.Model):
|
|
||||||
_name = 'sf.functional.cutting.tool.entity.cache'
|
|
||||||
_description = '功能刀具列表缓存'
|
|
||||||
|
|
||||||
code = fields.Char('编码')
|
|
||||||
name = fields.Char('名称')
|
|
||||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
|
||||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
|
||||||
|
|
||||||
# 整体式刀具型号
|
|
||||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
|
||||||
|
|
||||||
# 刀片型号
|
|
||||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '刀片')])
|
|
||||||
|
|
||||||
# 刀杆型号
|
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
|
||||||
|
|
||||||
# 刀盘型号
|
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
|
||||||
|
|
||||||
# 刀柄型号
|
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
|
||||||
|
|
||||||
# 夹头型号
|
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
|
||||||
domain=[('cutting_tool_material_id', '=', '夹头')])
|
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)')
|
|
||||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
|
||||||
string='刀具等级')
|
|
||||||
machining_accuracy = fields.Float('加工精度(mm)')
|
|
||||||
tool_length = fields.Float('装刀长(mm)')
|
|
||||||
blade_number = fields.Integer('刃数')
|
|
||||||
integral_blade_length = fields.Float('整体刃长(mm)')
|
|
||||||
effective_blade_length = fields.Float('有效刃长(mm)')
|
|
||||||
max_life = fields.Float('最大寿命值')
|
|
||||||
is_standard = fields.Selection([('1', '是'), ('0', '否')], '是否标准刀')
|
|
||||||
applicable_range = fields.Char('适用范围')
|
|
||||||
image = fields.Binary('图片')
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionalToolWarning(models.Model):
|
class FunctionalToolWarning(models.Model):
|
||||||
_name = 'sf.functional.tool.warning'
|
_name = 'sf.functional.tool.warning'
|
||||||
_description = '功能刀具预警'
|
_description = '功能刀具预警'
|
||||||
@@ -147,8 +102,12 @@ class FunctionalToolWarning(models.Model):
|
|||||||
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
|
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
|
||||||
functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装', readonly=True)
|
functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装', readonly=True)
|
||||||
|
|
||||||
code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
# code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
||||||
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.barcode_id')
|
||||||
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.functional_tool_name_id')
|
||||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||||
related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||||
|
|
||||||
@@ -261,8 +220,12 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
|||||||
if record:
|
if record:
|
||||||
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
||||||
|
|
||||||
code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
# code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
||||||
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.barcode_id')
|
||||||
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.functional_tool_name_id')
|
||||||
# mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
# mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||||
# related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
# related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||||
|
|
||||||
@@ -371,8 +334,12 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
|||||||
if record:
|
if record:
|
||||||
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
||||||
|
|
||||||
code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
# code = fields.Char('编码', readonly=True, related='functional_cutting_tool_id.code')
|
||||||
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.barcode_id')
|
||||||
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True,
|
||||||
|
related='functional_cutting_tool_id.functional_tool_name_id')
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
@@ -470,35 +437,28 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
_name = 'sf.machine.table.tool.changing.apply'
|
_name = 'sf.machine.table.tool.changing.apply'
|
||||||
_description = '机床换刀申请'
|
_description = '机床换刀申请'
|
||||||
|
|
||||||
# apply_to_tool_change_ids = fields.One2many(
|
|
||||||
# 'sf.tool.change.requirement.information',
|
|
||||||
# 'tool_change_to_apply_id',
|
|
||||||
# string='换刀需求信息',
|
|
||||||
# attrs="{'invisible': 1}")
|
|
||||||
|
|
||||||
name = fields.Many2one('maintenance.equipment', string='CNC机床', required=True, readonly=False,
|
name = fields.Many2one('maintenance.equipment', string='CNC机床', required=True, readonly=False,
|
||||||
group_expand='_read_group_names')
|
group_expand='_read_group_names')
|
||||||
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
|
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
|
||||||
compute='_compute_machine_table_type_id')
|
compute='_compute_machine_table_type_id')
|
||||||
machine_tool_code = fields.Char(string='机台号', invisible=True, readonly=True, compute='_compute_machine_tool_code')
|
machine_tool_code = fields.Char(string='机台号', store=True, invisible=True, readonly=True)
|
||||||
|
cutter_spacing_code = fields.Char(string='刀位号', readonly=False, required=True)
|
||||||
|
|
||||||
@api.depends('name')
|
@api.depends('name')
|
||||||
def _compute_machine_table_type_id(self):
|
def _compute_machine_table_type_id(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record:
|
if record:
|
||||||
record.machine_table_type_id = record.name.category_id.id
|
record.machine_table_type_id = record.name.category_id.id
|
||||||
|
|
||||||
@api.depends('name')
|
|
||||||
def _compute_machine_tool_code(self):
|
|
||||||
for record in self:
|
|
||||||
if record:
|
|
||||||
record.machine_tool_code = record.name.code
|
record.machine_tool_code = record.name.code
|
||||||
|
else:
|
||||||
|
record.machine_table_type_id = None
|
||||||
|
record.machine_tool_code = None
|
||||||
|
|
||||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=False)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号',
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_functional_tool_name_id')
|
domain=[('product_id.name', '=', '功能刀具')])
|
||||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称',
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
domain=[('name', '=', '功能刀具')])
|
||||||
compute='_compute_functional_tool_name_id')
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
||||||
|
|
||||||
diameter = fields.Char(string='直径(mm)', readonly=False)
|
diameter = fields.Char(string='直径(mm)', readonly=False)
|
||||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||||
@@ -510,8 +470,9 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
functional_tool_status = fields.Selection([('正常', '正常'), ('异常', '异常')], string='功能刀具状态',
|
functional_tool_status = fields.Selection([('正常', '正常'), ('异常', '异常')], string='功能刀具状态',
|
||||||
default='正常', readonly=False)
|
default='正常', readonly=False)
|
||||||
|
|
||||||
replacement_tool_code = fields.Char(string='待换功能刀具编码', readonly=True)
|
# replacement_tool_code = fields.Char(string='待换功能刀具编码', readonly=True)
|
||||||
replacement_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='待换功能刀具名称', readonly=True)
|
assembly_order_code = fields.Char(string='组装单编码', readonly=True)
|
||||||
|
replacement_tool_name_id = fields.Many2one('product.product', string='待换功能刀具名称', readonly=True)
|
||||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型',
|
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
||||||
@@ -522,22 +483,15 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
||||||
remark = fields.Char(string='备注说明', readonly=False)
|
remark = fields.Char(string='备注说明', readonly=False)
|
||||||
|
|
||||||
status = fields.Selection([('0', '未操作'), ('1', '已换刀申请'), ('2', '已转移')], string='操作状态', default='0')
|
status = fields.Selection([('0', '未操作'), ('1', '已换刀申请'), ('2', '已转移'), ('3', '已组装')], string='操作状态', default='0')
|
||||||
|
|
||||||
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装')
|
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装', readonly=True)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _read_group_names(self, categories, domain, order):
|
def _read_group_names(self, categories, domain, order):
|
||||||
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||||
return categories.browse(names)
|
return categories.browse(names)
|
||||||
|
|
||||||
@api.depends('functional_tool_name_id')
|
|
||||||
def _compute_functional_tool_name_id(self):
|
|
||||||
for record in self:
|
|
||||||
if record:
|
|
||||||
record.functional_tool_code = record.functional_tool_name_id.code
|
|
||||||
record.functional_tool_type_id = record.functional_tool_name_id.mrs_cutting_tool_type_id.id
|
|
||||||
|
|
||||||
@api.onchange('functional_tool_status')
|
@api.onchange('functional_tool_status')
|
||||||
def automation_apply_for_tool_change(self):
|
def automation_apply_for_tool_change(self):
|
||||||
"""
|
"""
|
||||||
@@ -549,7 +503,6 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
if self.functional_tool_status == '异常':
|
if self.functional_tool_status == '异常':
|
||||||
self.env['sf.machine.table.tool.changing.apply'].search([
|
self.env['sf.machine.table.tool.changing.apply'].search([
|
||||||
('name', '=', self.name.id)]).write({
|
('name', '=', self.name.id)]).write({
|
||||||
'replacement_tool_code': self.functional_tool_code,
|
|
||||||
'replacement_tool_name_id': self.functional_tool_name_id.id,
|
'replacement_tool_name_id': self.functional_tool_name_id.id,
|
||||||
'replacement_tool_type_id': self.functional_tool_type_id.id,
|
'replacement_tool_type_id': self.functional_tool_type_id.id,
|
||||||
'replacement_tool_coarse_middle_thin': self.coarse_middle_thin,
|
'replacement_tool_coarse_middle_thin': self.coarse_middle_thin,
|
||||||
@@ -563,7 +516,6 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
|
|
||||||
# 新建组装任务
|
# 新建组装任务
|
||||||
self.env['sf.functional.tool.assembly'].create({
|
self.env['sf.functional.tool.assembly'].create({
|
||||||
'functional_tool_code': self.functional_tool_code,
|
|
||||||
'name': self.functional_tool_name_id,
|
'name': self.functional_tool_name_id,
|
||||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
'functional_tool_type_id': self.functional_tool_type_id.id,
|
||||||
'functional_tool_diameter': self.diameter,
|
'functional_tool_diameter': self.diameter,
|
||||||
@@ -596,12 +548,11 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
"""
|
"""
|
||||||
# 撤回功能刀具组装创建的任务
|
# 撤回功能刀具组装创建的任务
|
||||||
self.env['sf.functional.tool.assembly'].search(
|
self.env['sf.functional.tool.assembly'].search(
|
||||||
[('functional_tool_code', '=', self.replacement_tool_code),
|
[('assembly_order_code', '=', self.assembly_order_code),
|
||||||
('loading_task_source', '=', '1')]).unlink()
|
('loading_task_source', '=', '1')]).unlink()
|
||||||
|
|
||||||
# 撤回数据更新
|
# 撤回数据更新
|
||||||
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name.id)]).write({
|
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name.id)]).write({
|
||||||
'replacement_tool_code': None,
|
|
||||||
'replacement_tool_name_id': None,
|
'replacement_tool_name_id': None,
|
||||||
'replacement_tool_type_id': None,
|
'replacement_tool_type_id': None,
|
||||||
'replacement_tool_coarse_middle_thin': None,
|
'replacement_tool_coarse_middle_thin': None,
|
||||||
@@ -624,16 +575,6 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
'status': '0'
|
'status': '0'
|
||||||
})
|
})
|
||||||
|
|
||||||
def open_sf_functional_tool_assembly(self):
|
|
||||||
"""
|
|
||||||
跳转到功能刀具组装界面按键功能
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
action = self.env.ref('sf_tool_management.sf_functional_tool_assembly_view_act')
|
|
||||||
result = action.read()[0]
|
|
||||||
result['domain'] = [('sf_machine_table_tool_changing_apply_id', '=', self.id)]
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
class CAMWorkOrderProgramKnifePlan(models.Model):
|
class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||||
_name = 'sf.cam.work.order.program.knife.plan'
|
_name = 'sf.cam.work.order.program.knife.plan'
|
||||||
@@ -642,8 +583,10 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
name = fields.Char(string='工单任务编号', readonly=False)
|
name = fields.Char(string='工单任务编号', readonly=False)
|
||||||
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
|
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
|
||||||
cam_cutter_spacing_code = fields.Char(string='CAM刀位号', readonly=False)
|
cam_cutter_spacing_code = fields.Char(string='CAM刀位号', readonly=False)
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=False)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号',
|
||||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
domain=[('product_id.name', '=', '功能刀具')])
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称',
|
||||||
|
domain=[('name', '=', '功能刀具')])
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
||||||
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False,
|
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False,
|
||||||
group_expand='_read_group_machine_table_name_ids')
|
group_expand='_read_group_machine_table_name_ids')
|
||||||
@@ -671,7 +614,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
reason_for_applying = fields.Char(string='申请原因', readonly=False)
|
reason_for_applying = fields.Char(string='申请原因', readonly=False)
|
||||||
remark = fields.Char(string='备注说明', readonly=False)
|
remark = fields.Char(string='备注说明', readonly=False)
|
||||||
|
|
||||||
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装')
|
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装', readonly=True)
|
||||||
|
|
||||||
def apply_for_tooling(self):
|
def apply_for_tooling(self):
|
||||||
"""
|
"""
|
||||||
@@ -679,8 +622,8 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
record = self.env['sf.functional.tool.assembly'].create({
|
record = self.env['sf.functional.tool.assembly'].create({
|
||||||
'functional_tool_code': self.functional_tool_code,
|
'barcode_id': self.barcode_id.id,
|
||||||
'name': self.functional_tool_name_id.id,
|
'functional_tool_name_id': self.functional_tool_name_id.id,
|
||||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
'functional_tool_type_id': self.functional_tool_type_id.id,
|
||||||
'functional_tool_diameter': self.diameter,
|
'functional_tool_diameter': self.diameter,
|
||||||
'functional_tool_length': self.tool_loading_length,
|
'functional_tool_length': self.tool_loading_length,
|
||||||
@@ -699,7 +642,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
|
|
||||||
# 将计划执行状态改为执行中
|
# 将计划执行状态改为执行中
|
||||||
self.env['sf.cam.work.order.program.knife.plan'].search(
|
self.env['sf.cam.work.order.program.knife.plan'].search(
|
||||||
[('functional_tool_code', '=', self.functional_tool_code)]).write({
|
[('barcode_id', '=', self.barcode_id.id)]).write({
|
||||||
'plan_execute_status': '1',
|
'plan_execute_status': '1',
|
||||||
'applicant': self.env.user.name})
|
'applicant': self.env.user.name})
|
||||||
|
|
||||||
@@ -709,35 +652,27 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
self.env['sf.functional.tool.assembly'].search(
|
self.env['sf.functional.tool.assembly'].search(
|
||||||
[('functional_tool_code', '=', self.functional_tool_code),
|
[('barcode_id', '=', self.barcode_id.id),
|
||||||
('loading_task_source', '=', '0')]).unlink()
|
('loading_task_source', '=', '0')]).unlink()
|
||||||
|
|
||||||
# 将计划执行状态改为待执行,同时清除申请人、功能刀具组装字段数据
|
# 将计划执行状态改为待执行,同时清除申请人、功能刀具组装字段数据
|
||||||
self.env['sf.cam.work.order.program.knife.plan'].search(
|
self.env['sf.cam.work.order.program.knife.plan'].search(
|
||||||
[('functional_tool_code', '=', self.functional_tool_code)]).write({
|
[('barcode_id', '=', self.barcode_id.id)]).write({
|
||||||
'plan_execute_status': '0',
|
'plan_execute_status': '0',
|
||||||
'applicant': None,
|
'applicant': None,
|
||||||
'sf_functional_tool_assembly_id': None,
|
'sf_functional_tool_assembly_id': None,
|
||||||
})
|
})
|
||||||
|
|
||||||
def open_sf_functional_tool_assembly(self):
|
|
||||||
"""
|
|
||||||
跳转到功能刀具组装界面按键功能
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
action = self.env.ref('sf_tool_management.sf_functional_tool_assembly_view_act')
|
|
||||||
result = action.read()[0]
|
|
||||||
result['domain'] = [('sf_cam_work_order_program_knife_plan_id', '=', self.id)]
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionalToolAssembly(models.Model):
|
class FunctionalToolAssembly(models.Model):
|
||||||
_name = 'sf.functional.tool.assembly'
|
_name = 'sf.functional.tool.assembly'
|
||||||
_description = '功能刀具组装'
|
_description = '功能刀具组装单'
|
||||||
_order = 'use_tool_time asc'
|
_order = 'use_tool_time asc'
|
||||||
|
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
assembly_order_code = fields.Char(string='编码', readonly=True)
|
||||||
name = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True)
|
||||||
|
name = fields.Char(string='名称', readonly=True)
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||||
group_expand='_read_group_functional_tool_type_ids')
|
group_expand='_read_group_functional_tool_type_ids')
|
||||||
|
|
||||||
@@ -787,6 +722,58 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
chuck_name = fields.Char('夹头名称', readonly=True)
|
chuck_name = fields.Char('夹头名称', readonly=True)
|
||||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
||||||
|
|
||||||
|
@api.depends('integral_code_id', 'blade_code_id', 'bar_code_id', 'pad_code_id', 'handle_code_id', 'chuck_code_id')
|
||||||
|
def _compute_auto_fill(self):
|
||||||
|
for record in self:
|
||||||
|
if record.integral_code_id:
|
||||||
|
record.cutting_tool_integral_model_id = record.integral_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.integral_name = record.integral_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_1 = record.integral_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_integral_model_id = None
|
||||||
|
record.integral_name = None
|
||||||
|
record.sf_tool_brand_id_1 = None
|
||||||
|
if record.blade_code_id:
|
||||||
|
record.cutting_tool_blade_model_id = record.blade_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.blade_name = record.blade_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_2 = record.blade_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_blade_model_id = None
|
||||||
|
record.blade_name = None
|
||||||
|
record.sf_tool_brand_id_2 = None
|
||||||
|
if record.bar_code_id:
|
||||||
|
record.cutting_tool_cutterbar_model_id = record.bar_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.bar_name = record.bar_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_3 = record.bar_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_cutterbar_model_id = None
|
||||||
|
record.bar_name = None
|
||||||
|
record.sf_tool_brand_id_3 = None
|
||||||
|
if record.pad_code_id:
|
||||||
|
record.cutting_tool_cutterpad_model_id = record.pad_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.pad_name = record.pad_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_4 = record.pad_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_cutterpad_model_id = None
|
||||||
|
record.pad_name = None
|
||||||
|
record.sf_tool_brand_id_4 = None
|
||||||
|
if record.handle_code_id:
|
||||||
|
record.cutting_tool_cutterhandle_model_id = record.handle_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.handle_name = record.handle_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_5 = record.handle_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_cutterhandle_model_id = None
|
||||||
|
record.handle_name = None
|
||||||
|
record.sf_tool_brand_id_5 = None
|
||||||
|
if record.chuck_code_id:
|
||||||
|
record.cutting_tool_cutterhead_model_id = record.chuck_code_id.product_id.cutting_tool_material_id.id
|
||||||
|
record.chuck_name = record.chuck_code_id.product_id.name
|
||||||
|
record.sf_tool_brand_id_6 = record.chuck_code_id.product_id.brand_id.id
|
||||||
|
else:
|
||||||
|
record.cutting_tool_cutterhead_model_id = None
|
||||||
|
record.chuck_name = None
|
||||||
|
record.sf_tool_brand_id_6 = None
|
||||||
|
|
||||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
||||||
tool_loading_length = fields.Char(string='装刀长(mm)', readonly=True)
|
tool_loading_length = fields.Char(string='装刀长(mm)', readonly=True)
|
||||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
||||||
@@ -795,11 +782,12 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
cut_length = fields.Char(string='已切削长度(mm)', readonly=True)
|
cut_length = fields.Char(string='已切削长度(mm)', readonly=True)
|
||||||
cut_number = fields.Char(string='已切削次数', readonly=True)
|
cut_number = fields.Char(string='已切削次数', readonly=True)
|
||||||
|
|
||||||
loading_task_source = fields.Selection([('0', 'CAM装刀'), ('1', '机台换刀')], string='装刀任务来源', readonly=True)
|
loading_task_source = fields.Selection([('0', 'CAM装刀'), ('1', '机台换刀'), ('2', '按库存组装')],
|
||||||
|
string='装刀任务来源', readonly=True)
|
||||||
applicant = fields.Char(string='申请人', readonly=True)
|
applicant = fields.Char(string='申请人', readonly=True)
|
||||||
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
||||||
apply_time = fields.Datetime(string='申请时间', default=fields.Datetime.now(), readonly=True)
|
apply_time = fields.Datetime(string='申请时间', default=fields.Datetime.now(), readonly=True)
|
||||||
assemble_status = fields.Selection([('0', '待组装'), ('1', '已组装'), ('2', '已出库')], string='组装状态',
|
assemble_status = fields.Selection([('0', '待组装'), ('1', '已组装')], string='组装状态',
|
||||||
default='0', readonly=True)
|
default='0', readonly=True)
|
||||||
use_tool_time = fields.Datetime(string='用刀时间', readonly=True)
|
use_tool_time = fields.Datetime(string='用刀时间', readonly=True)
|
||||||
production_line_name_id = fields.Many2one('sf.production.line', string='产线名称', readonly=False)
|
production_line_name_id = fields.Many2one('sf.production.line', string='产线名称', readonly=False)
|
||||||
@@ -814,159 +802,33 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
remark = fields.Char(string='备注说明', readonly=True)
|
remark = fields.Char(string='备注说明', readonly=True)
|
||||||
|
|
||||||
check_box_1 = fields.Boolean(string='复选框', default=False, readonly=False)
|
check_box_1 = fields.Boolean(string='复选框', default=False, readonly=False)
|
||||||
sf_machine_table_tool_changing_apply_id = fields.Many2one('sf.machine.table.tool.changing.apply', '机床换刀申请')
|
sf_machine_table_tool_changing_apply_id = fields.Many2one('sf.machine.table.tool.changing.apply', '机床换刀申请', readonly=True)
|
||||||
sf_cam_work_order_program_knife_plan_id = fields.Many2one('sf.cam.work.order.program.knife.plan',
|
sf_cam_work_order_program_knife_plan_id = fields.Many2one('sf.cam.work.order.program.knife.plan',
|
||||||
'CAM工单程序用刀计划')
|
'CAM工单程序用刀计划', readonly=True, )
|
||||||
|
|
||||||
def open_sf_cam_work_order_program_knife_plan(self):
|
def _get_code(self, loading_task_source):
|
||||||
"""
|
"""
|
||||||
跳转到CAM工单程序用刀计划界面按钮功能
|
自动生成组装单编码
|
||||||
"""
|
"""
|
||||||
action = self.env.ref('sf_tool_management.sf_cam_work_order_program_knife_plan_view_act')
|
new_time = str(fields.Date.today())
|
||||||
result = action.read()[0]
|
datetime = new_time[2:4] + new_time[5:7] + new_time[-2:]
|
||||||
result['domain'] = [('sf_functional_tool_assembly_id', '=', self.id)]
|
functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().search(
|
||||||
return result
|
[('loading_task_source', '=', loading_task_source),
|
||||||
|
('assembly_order_code', 'ilike', datetime)], limit=1, order="id desc")
|
||||||
def open_sf_machine_table_tool_changing_apply(self):
|
if not functional_tool_assembly:
|
||||||
"""
|
num = "%03d" % 1
|
||||||
跳转到机床换刀申请界面按钮功能
|
|
||||||
"""
|
|
||||||
action = self.env.ref('sf_tool_management.sf_machine_table_tool_changing_apply_view_act')
|
|
||||||
result = action.read()[0]
|
|
||||||
result['domain'] = [('sf_functional_tool_assembly_id', '=', self.id)]
|
|
||||||
return result
|
|
||||||
|
|
||||||
def cancel_functional_tool_assembly(self):
|
|
||||||
"""
|
|
||||||
取消功能刀具组装
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
if self.new_former == '0':
|
|
||||||
# 如果是新刀,则删除功能刀具列表、功能刀具预警、功能刀具实时分布、功能刀具出入库记录的记录
|
|
||||||
record = self.env['sf.functional.cutting.tool.entity'].search([
|
|
||||||
('code', '=', self.functional_tool_code)])
|
|
||||||
self.env['sf.functional.tool.warning'].search(
|
|
||||||
[('functional_cutting_tool_id', '=', record.id)]).unlink()
|
|
||||||
self.env['sf.real.time.distribution.of.functional.tools'].search(
|
|
||||||
[('functional_cutting_tool_id', '=', record.id)]).unlink()
|
|
||||||
self.env['sf.inbound.and.outbound.records.of.functional.tools'].search(
|
|
||||||
[('functional_cutting_tool_id', '=', record.id)]).unlink()
|
|
||||||
record.unlink()
|
|
||||||
else:
|
else:
|
||||||
# 获取功能刀具缓存信息
|
m = int(functional_tool_assembly.assembly_order_code[-3:]) + 1
|
||||||
record = self.env['sf.functional.cutting.tool.entity.cache'].search([
|
num = "%03d" % m
|
||||||
('code', '=', self.functional_tool_code)], limit=1)
|
if loading_task_source == '0':
|
||||||
# # 删除现有功能刀具列表记录
|
code = 'CAMZZD' + datetime + str(num)
|
||||||
# self.env['sf.functional.cutting.tool.entity'].search([
|
elif loading_task_source == '1':
|
||||||
# ('code', '=', self.functional_tool_code)]).unlink()
|
code = 'JTZZD' + datetime + str(num)
|
||||||
# 修改功能刀具列表信息
|
elif loading_task_source == '2':
|
||||||
self.env['sf.functional.cutting.tool.entity'].search([
|
code = 'MTSZZD' + datetime + str(num)
|
||||||
('code', '=', self.functional_tool_code)]).sudo().write({
|
|
||||||
'code': record.code,
|
|
||||||
'name': record.name,
|
|
||||||
'mrs_cutting_tool_type_id': record.mrs_cutting_tool_type_id.id,
|
|
||||||
'mrs_cutting_tool_model_id': record.mrs_cutting_tool_model_id.id,
|
|
||||||
'cutting_tool_integral_model_id': record.cutting_tool_integral_model_id.id,
|
|
||||||
'cutting_tool_blade_model_id': record.cutting_tool_blade_model_id.id,
|
|
||||||
'cutting_tool_cutterbar_model_id': record.cutting_tool_cutterbar_model_id.id,
|
|
||||||
'cutting_tool_cutterpad_model_id': record.cutting_tool_cutterpad_model_id.id,
|
|
||||||
'cutting_tool_cutterhandle_model_id': record.cutting_tool_cutterhandle_model_id.id,
|
|
||||||
'cutting_tool_cutterhead_model_id': record.cutting_tool_cutterhead_model_id.id,
|
|
||||||
'diameter': record.diameter,
|
|
||||||
'tool_grade': record.tool_grade,
|
|
||||||
'machining_accuracy': record.machining_accuracy,
|
|
||||||
'tool_length': record.tool_length,
|
|
||||||
'blade_number': record.blade_number,
|
|
||||||
'integral_blade_length': record.integral_blade_length,
|
|
||||||
'effective_blade_length': record.effective_blade_length,
|
|
||||||
'max_life': record.max_life,
|
|
||||||
'is_standard': record.is_standard,
|
|
||||||
'applicable_range': record.applicable_range,
|
|
||||||
'image': record.image,
|
|
||||||
})
|
|
||||||
# 删除功能刀具缓存信息
|
|
||||||
self.env['sf.functional.cutting.tool.entity.cache'].search([
|
|
||||||
('code', '=', self.functional_tool_code)]).unlink()
|
|
||||||
|
|
||||||
# 修改功能刀具组装的组装信息
|
|
||||||
self.env['sf.functional.tool.assembly'].search([
|
|
||||||
('machine_tool_name_id', '=', self.machine_tool_name_id.id),
|
|
||||||
('cutter_spacing_code', '=', self.cutter_spacing_code),
|
|
||||||
('assemble_status', '=', '1')
|
|
||||||
]).write({
|
|
||||||
'cutting_tool_integral_model_id': None,
|
|
||||||
'integral_code': None,
|
|
||||||
'integral_name': None,
|
|
||||||
'sf_tool_brand_id_1': None,
|
|
||||||
'cutting_tool_blade_model_id': None,
|
|
||||||
'blade_code': None,
|
|
||||||
'blade_name': None,
|
|
||||||
'sf_tool_brand_id_2': None,
|
|
||||||
'cutting_tool_cutterbar_model_id': None,
|
|
||||||
'bar_code': None,
|
|
||||||
'bar_name': None,
|
|
||||||
'sf_tool_brand_id_3': None,
|
|
||||||
'cutting_tool_cutterpad_model_id': None,
|
|
||||||
'pad_code': None,
|
|
||||||
'pad_name': None,
|
|
||||||
'sf_tool_brand_id_4': None,
|
|
||||||
'cutting_tool_cutterhandle_model_id': None,
|
|
||||||
'handle_code': None,
|
|
||||||
'handle_name': None,
|
|
||||||
'sf_tool_brand_id_5': None,
|
|
||||||
'cutting_tool_cutterhead_model_id': None,
|
|
||||||
'chuck_code': None,
|
|
||||||
'chuck_name': None,
|
|
||||||
'sf_tool_brand_id_6': None,
|
|
||||||
'coarse_middle_thin': None,
|
|
||||||
'tool_loading_length': None,
|
|
||||||
'new_former': None,
|
|
||||||
'reference_length': None,
|
|
||||||
'cut_time': None,
|
|
||||||
'cut_length': None,
|
|
||||||
'cut_number': None,
|
|
||||||
'assemble_status': '0',
|
|
||||||
'tool_loading_person': None,
|
|
||||||
'tool_loading_time': None
|
|
||||||
})
|
|
||||||
|
|
||||||
def show_popup(self):
|
|
||||||
"""
|
|
||||||
单个功能刀具出库
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
self.env['sf.delivery.of.cargo.from.storage'].search([]).unlink()
|
|
||||||
|
|
||||||
vals = self.env['sf.functional.tool.assembly'].search(
|
|
||||||
[('check_box_1', '=', True), ('assemble_status', '=', '1')])
|
|
||||||
if vals:
|
|
||||||
for val in vals:
|
|
||||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
|
||||||
'functional_tool_code': val.functional_tool_code,
|
|
||||||
'name': val.name.id,
|
|
||||||
'functional_tool_type_id': val.functional_tool_type_id.id,
|
|
||||||
'production_line_name_id': val.production_line_name_id.id,
|
|
||||||
'machine_tool_code': val.machine_tool_code,
|
|
||||||
'receive_person': val.receive_person,
|
|
||||||
'receive_time': val.receive_time})
|
|
||||||
else:
|
else:
|
||||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
code = False
|
||||||
'functional_tool_code': self.functional_tool_code,
|
return code
|
||||||
'name': self.name.id,
|
|
||||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
|
||||||
'production_line_name_id': self.production_line_name_id.id,
|
|
||||||
'machine_tool_code': self.machine_tool_code,
|
|
||||||
'receive_person': self.receive_person,
|
|
||||||
'receive_time': self.receive_time})
|
|
||||||
|
|
||||||
return {
|
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'name': '功能刀具出库',
|
|
||||||
'res_model': 'sf.delivery.of.cargo.from.storage',
|
|
||||||
'view_mode': 'tree',
|
|
||||||
'view_type': 'tree',
|
|
||||||
'target': 'new'
|
|
||||||
}
|
|
||||||
|
|
||||||
def automated_assembly(self):
|
def automated_assembly(self):
|
||||||
"""
|
"""
|
||||||
@@ -985,3 +847,12 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
todo 组装单打印
|
todo 组装单打印
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, vals):
|
||||||
|
obj = super(FunctionalToolAssembly, self).create(vals)
|
||||||
|
if obj.loading_task_source:
|
||||||
|
code = self._get_code(obj.loading_task_source)
|
||||||
|
obj.assembly_order_code = code
|
||||||
|
obj.name = code
|
||||||
|
return obj
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_sf_functional_cutting_tool_entity,sf.functional.cutting.tool.entity,model_sf_functional_cutting_tool_entity,base.group_user,1,1,1,1
|
access_sf_functional_cutting_tool_entity,sf.functional.cutting.tool.entity,model_sf_functional_cutting_tool_entity,base.group_user,1,1,1,1
|
||||||
access_sf_functional_cutting_tool_entity_cache,sf.functional.cutting.tool.entity.cache,model_sf_functional_cutting_tool_entity_cache,base.group_user,1,1,1,1
|
|
||||||
access_sf_functional_tool_warning,sf.functional.tool.warning,model_sf_functional_tool_warning,base.group_user,1,1,1,1
|
access_sf_functional_tool_warning,sf.functional.tool.warning,model_sf_functional_tool_warning,base.group_user,1,1,1,1
|
||||||
access_sf_real_time_distribution_of_functional_tools,sf.real.time.distribution.of.functional.tools,model_sf_real_time_distribution_of_functional_tools,base.group_user,1,1,1,1
|
access_sf_real_time_distribution_of_functional_tools,sf.real.time.distribution.of.functional.tools,model_sf_real_time_distribution_of_functional_tools,base.group_user,1,1,1,1
|
||||||
access_sf_inbound_and_outbound_records_of_functional_tools,sf.inbound.and.outbound.records.of.functional.tools,model_sf_inbound_and_outbound_records_of_functional_tools,base.group_user,1,1,1,1
|
access_sf_inbound_and_outbound_records_of_functional_tools,sf.inbound.and.outbound.records.of.functional.tools,model_sf_inbound_and_outbound_records_of_functional_tools,base.group_user,1,1,1,1
|
||||||
@@ -15,7 +14,6 @@ access_sf_tool_transfer_request_information,sf.tool.transfer.request.information
|
|||||||
|
|
||||||
access_sf_functional_tool_assembly,sf.functional.tool.assembly,model_sf_functional_tool_assembly,base.group_user,1,1,1,1
|
access_sf_functional_tool_assembly,sf.functional.tool.assembly,model_sf_functional_tool_assembly,base.group_user,1,1,1,1
|
||||||
access_sf_functional_tool_assembly_order,sf.functional.tool.assembly.order,model_sf_functional_tool_assembly_order,base.group_user,1,1,1,1
|
access_sf_functional_tool_assembly_order,sf.functional.tool.assembly.order,model_sf_functional_tool_assembly_order,base.group_user,1,1,1,1
|
||||||
access_sf_delivery_of_cargo_from_storage,sf.delivery.of.cargo.from.storage,model_sf_delivery_of_cargo_from_storage,base.group_user,1,1,1,1
|
|
||||||
access_sf_tool_material_search,sf.tool.material.search,model_sf_tool_material_search,base.group_user,1,1,1,1
|
access_sf_tool_material_search,sf.tool.material.search,model_sf_tool_material_search,base.group_user,1,1,1,1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -7,8 +7,8 @@
|
|||||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="功能刀具列表" create="0" edit="0" delete="0">
|
<tree string="功能刀具列表" create="0" edit="0" delete="0">
|
||||||
<field name="code" />
|
<field name="barcode_id" />
|
||||||
<field name="name" />
|
<field name="functional_tool_name_id" />
|
||||||
<field name="mrs_cutting_tool_type_id" />
|
<field name="mrs_cutting_tool_type_id" />
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -29,14 +29,13 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" invisible="False" placeholder="请输入20字以内的名称"/>
|
<field name="barcode_id" readonly="1" nolabel="True"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="code" readonly="1" nolabel="True"/>
|
<field name="functional_tool_name_id" invisible="False" placeholder="请输入20字以内的名称"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
|
|
||||||
<field name="cutting_tool_integral_model_id"
|
<field name="cutting_tool_integral_model_id"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}"
|
||||||
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"
|
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"
|
||||||
@@ -149,8 +148,8 @@
|
|||||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="code" />
|
<field name="barcode_id" />
|
||||||
<field name="name" />
|
<field name="functional_tool_name_id" />
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -179,9 +178,9 @@
|
|||||||
<field name="model">sf.functional.tool.warning</field>
|
<field name="model">sf.functional.tool.warning</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="功能刀具预警" create="0" edit="0" delete="0" >
|
<tree string="功能刀具预警" create="0" edit="0" delete="0" >
|
||||||
<field name="code" />
|
<field name="barcode_id" />
|
||||||
<field name="name" />
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="mrs_cutting_tool_type_id" />
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_cutterbar_model_id" optional="hide"/>
|
<field name="cutting_tool_cutterbar_model_id" optional="hide"/>
|
||||||
@@ -209,12 +208,12 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" invisible="False"/>
|
<field name="barcode_id" readonly="1"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="code" readonly="1"/>
|
<field name="functional_tool_name_id" invisible="False"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
|
|
||||||
<field name="cutting_tool_integral_model_id"
|
<field name="cutting_tool_integral_model_id"
|
||||||
@@ -299,8 +298,8 @@
|
|||||||
<field name="model">sf.functional.tool.warning</field>
|
<field name="model">sf.functional.tool.warning</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="功能刀具预警">
|
<search string="功能刀具预警">
|
||||||
<field name="code" />
|
<field name="barcode_id" />
|
||||||
<field name="name" />
|
<field name="functional_tool_name_id" />
|
||||||
<field name="mrs_cutting_tool_type_id" />
|
<field name="mrs_cutting_tool_type_id" />
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -338,10 +337,9 @@
|
|||||||
<field name="model">sf.real.time.distribution.of.functional.tools</field>
|
<field name="model">sf.real.time.distribution.of.functional.tools</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree create="0" edit="0" delete="0" >
|
<tree create="0" edit="0" delete="0" >
|
||||||
<field name="code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="name"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
|
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_cutterbar_model_id" optional="hide"/>
|
<field name="cutting_tool_cutterbar_model_id" optional="hide"/>
|
||||||
@@ -371,12 +369,12 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" invisible="False"/>
|
<field name="barcode_id" readonly="1"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="code" readonly="1"/>
|
<field name="functional_tool_name_id" invisible="False"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
|
|
||||||
<field name="cutting_tool_integral_model_id"
|
<field name="cutting_tool_integral_model_id"
|
||||||
@@ -465,8 +463,8 @@
|
|||||||
<field name="model">sf.real.time.distribution.of.functional.tools</field>
|
<field name="model">sf.real.time.distribution.of.functional.tools</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="name"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -496,8 +494,8 @@
|
|||||||
<field name="model">sf.inbound.and.outbound.records.of.functional.tools</field>
|
<field name="model">sf.inbound.and.outbound.records.of.functional.tools</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="功能刀具出入库记录" create="0" edit="0" delete="0">
|
<tree string="功能刀具出入库记录" create="0" edit="0" delete="0">
|
||||||
<field name="code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="name"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -521,12 +519,12 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" invisible="False"/>
|
<field name="barcode_id" readonly="1"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="code" readonly="1"/>
|
<field name="functional_tool_name_id" invisible="False"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
|
|
||||||
<field name="cutting_tool_integral_model_id"
|
<field name="cutting_tool_integral_model_id"
|
||||||
@@ -608,8 +606,8 @@
|
|||||||
<field name="model">sf.inbound.and.outbound.records.of.functional.tools</field>
|
<field name="model">sf.inbound.and.outbound.records.of.functional.tools</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="name"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="mrs_cutting_tool_type_id"/>
|
<field name="mrs_cutting_tool_type_id"/>
|
||||||
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
<field name="cutting_tool_integral_model_id" optional="hide"/>
|
||||||
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
<field name="cutting_tool_blade_model_id" optional="hide"/>
|
||||||
@@ -700,9 +698,9 @@
|
|||||||
<field name="machine_tool_code" invisible="1"/>
|
<field name="machine_tool_code" invisible="1"/>
|
||||||
<field name="machine_table_type_id"/>
|
<field name="machine_table_type_id"/>
|
||||||
<field name="cutter_spacing_code"/>
|
<field name="cutter_spacing_code"/>
|
||||||
<field name="functional_tool_code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="replacement_tool_code"/>
|
<!-- <field name="replacement_tool_code"/>-->
|
||||||
<field name="replacement_tool_name_id"/>
|
<field name="replacement_tool_name_id"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
|
|
||||||
@@ -714,11 +712,10 @@
|
|||||||
type="action"
|
type="action"
|
||||||
context="{ 'default_name':name,
|
context="{ 'default_name':name,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_functional_tool_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_functional_tool_name_id': functional_tool_name_id,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id,
|
'default_functional_tool_type_id': functional_tool_type_id,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_replacement_tool_code': functional_tool_code,
|
|
||||||
'default_replacement_tool_name_id': functional_tool_name_id,
|
'default_replacement_tool_name_id': functional_tool_name_id,
|
||||||
'default_replacement_tool_type_id': functional_tool_type_id,
|
'default_replacement_tool_type_id': functional_tool_type_id,
|
||||||
'default_replacement_tool_coarse_middle_thin': coarse_middle_thin}"
|
'default_replacement_tool_coarse_middle_thin': coarse_middle_thin}"
|
||||||
@@ -731,15 +728,13 @@
|
|||||||
context="{ 'default_CNC_machine_table_id':name,
|
context="{ 'default_CNC_machine_table_id':name,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_functional_tool_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_functional_tool_name_id': functional_tool_name_id,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id}"
|
'default_functional_tool_type_id': functional_tool_type_id}"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': [('status', '!=', '0')]}"
|
attrs="{'invisible': [('status', '!=', '0')]}"
|
||||||
/>
|
/>
|
||||||
<button string="查看组装单" type="object" name="open_sf_functional_tool_assembly"
|
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
||||||
class="oe_highlight" attrs="{'invisible': [('status', '!=', '1')]}"/>
|
|
||||||
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
|
||||||
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '2')]}" confirm="是否确认撤回转移"/>
|
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '2')]}" confirm="是否确认撤回转移"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -756,11 +751,10 @@
|
|||||||
type="action"
|
type="action"
|
||||||
context="{ 'default_name':name,
|
context="{ 'default_name':name,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_functional_tool_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_functional_tool_name_id': functional_tool_name_id,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id,
|
'default_functional_tool_type_id': functional_tool_type_id,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_replacement_tool_code': functional_tool_code,
|
|
||||||
'default_replacement_tool_name_id': functional_tool_name_id,
|
'default_replacement_tool_name_id': functional_tool_name_id,
|
||||||
'default_replacement_tool_type_id': functional_tool_type_id,
|
'default_replacement_tool_type_id': functional_tool_type_id,
|
||||||
'default_replacement_tool_coarse_middle_thin': coarse_middle_thin}"
|
'default_replacement_tool_coarse_middle_thin': coarse_middle_thin}"
|
||||||
@@ -773,13 +767,11 @@
|
|||||||
context="{ 'default_CNC_machine_table_id':name,
|
context="{ 'default_CNC_machine_table_id':name,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_functional_tool_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_functional_tool_name_id': functional_tool_name_id,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id}"
|
'default_functional_tool_type_id': functional_tool_type_id}"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': [('status', '!=', '0')]}"/>
|
attrs="{'invisible': [('status', '!=', '0')]}"/>
|
||||||
<button string="查看组装单" type="object" name="open_sf_functional_tool_assembly"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('status', '!=', '1')]}"/>
|
|
||||||
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
||||||
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '2')]}" confirm="是否确认撤回转移"/>
|
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', '2')]}" confirm="是否确认撤回转移"/>
|
||||||
</header>
|
</header>
|
||||||
@@ -791,10 +783,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="machine_table_type_id"/>
|
|
||||||
<field name="machine_tool_code" invisible="True"/>
|
<field name="machine_tool_code" invisible="True"/>
|
||||||
|
<field name="machine_table_type_id"/>
|
||||||
<field name="cutter_spacing_code"/>
|
<field name="cutter_spacing_code"/>
|
||||||
<field name="functional_tool_code"/>
|
<field name="sf_functional_tool_assembly_id" string="组装单"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id" placeholder="请选择"/>
|
<field name="functional_tool_name_id" placeholder="请选择"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
</group>
|
</group>
|
||||||
@@ -810,7 +805,7 @@
|
|||||||
<field name="status" invisible="True"/>
|
<field name="status" invisible="True"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="replacement_tool_code"/>
|
<!-- <field name="replacement_tool_code"/>-->
|
||||||
<field name="used_tool_time"/>
|
<field name="used_tool_time"/>
|
||||||
<field name="new_former"/>
|
<field name="new_former"/>
|
||||||
<field name="reason_for_applying" />
|
<field name="reason_for_applying" />
|
||||||
@@ -854,9 +849,9 @@
|
|||||||
<field name="machine_tool_code" invisible="1"/>
|
<field name="machine_tool_code" invisible="1"/>
|
||||||
<field name="machine_table_type_id"/>
|
<field name="machine_table_type_id"/>
|
||||||
<field name="cutter_spacing_code"/>
|
<field name="cutter_spacing_code"/>
|
||||||
<field name="functional_tool_code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="replacement_tool_code"/>
|
<!-- <field name="replacement_tool_code"/>-->
|
||||||
<field name="replacement_tool_name_id"/>
|
<field name="replacement_tool_name_id"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
@@ -892,8 +887,6 @@
|
|||||||
<field name="remark" optional="hide"/>
|
<field name="remark" optional="hide"/>
|
||||||
<field name="plan_execute_status" invisible="True"/>
|
<field name="plan_execute_status" invisible="True"/>
|
||||||
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
||||||
<button string="查看组装单" type="object" name="open_sf_functional_tool_assembly"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}"/>
|
|
||||||
<button string="撤回" name="revocation" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
<button string="撤回" name="revocation" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -906,8 +899,6 @@
|
|||||||
<form>
|
<form>
|
||||||
<header>
|
<header>
|
||||||
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
||||||
<button string="查看组装单" type="object" name="open_sf_functional_tool_assembly"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}"/>
|
|
||||||
<button string="撤回" name="revocation" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
<button string="撤回" name="revocation" type="object" class="btn-primary" attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
||||||
<field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>
|
<field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>
|
||||||
</header>
|
</header>
|
||||||
@@ -923,12 +914,13 @@
|
|||||||
<field name="cam_procedure_code"/>
|
<field name="cam_procedure_code"/>
|
||||||
<field name="cam_cutter_spacing_code"/>
|
<field name="cam_cutter_spacing_code"/>
|
||||||
<field name="machine_table_name_id" placeholder="请选择"/>
|
<field name="machine_table_name_id" placeholder="请选择"/>
|
||||||
|
<field name="machine_tool_cutter_spacing_code"/>
|
||||||
|
<field name="sf_functional_tool_assembly_id" string="组装单"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="functional_tool_code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id" placeholder="请选择"/>
|
<field name="functional_tool_name_id" placeholder="请选择"/>
|
||||||
<field name="functional_tool_type_id" placeholder="请选择"/>
|
<field name="functional_tool_type_id" placeholder="请选择"/>
|
||||||
<field name="machine_tool_cutter_spacing_code"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
@@ -997,10 +989,12 @@
|
|||||||
<field name="model">sf.functional.tool.assembly</field>
|
<field name="model">sf.functional.tool.assembly</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree create="0">
|
<tree create="0">
|
||||||
<field name="functional_tool_code"/>
|
<field name="assembly_order_code"/>
|
||||||
<field name="name"/>
|
<field name="barcode_id" optional="hide"/>
|
||||||
|
<!-- <field name="functional_tool_code" invisible="1"/>-->
|
||||||
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
<field name="loading_task_source" optional="hide"/>
|
<field name="loading_task_source"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
<field name="assemble_status" optional="hide"/>
|
<field name="assemble_status" optional="hide"/>
|
||||||
<field name="use_tool_time" />
|
<field name="use_tool_time" />
|
||||||
@@ -1021,9 +1015,9 @@
|
|||||||
context="{
|
context="{
|
||||||
'default_machine_tool_name_id': machine_tool_name_id,
|
'default_machine_tool_name_id': machine_tool_name_id,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_functional_tool_name_id': name,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id,
|
'default_functional_tool_type_id': functional_tool_type_id,
|
||||||
'default_functional_tool_length': functional_tool_length,
|
'default_functional_tool_length': functional_tool_length,
|
||||||
'default_effective_length': None,
|
'default_effective_length': None,
|
||||||
@@ -1034,13 +1028,8 @@
|
|||||||
'default_whether_standard_tool': None}"
|
'default_whether_standard_tool': None}"
|
||||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
<button string="取消组装" name="cancel_functional_tool_assembly" type="object" attrs="{'invisible': [('assemble_status', '!=', '1')]}" class="btn-primary" confirm="是否确认取消组装"/>
|
<button string="组装单打印" name="assemble_single_print" type="object"
|
||||||
<button string="出库" name="show_popup" type="object" attrs="{'invisible': [('assemble_status', '!=', '1')]}" class="btn-primary"/>
|
attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印组装单"/>
|
||||||
<button string="组装单打印" name="assemble_single_print" type="object" attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印组装单"/>
|
|
||||||
<button string="查看CAM工单程序用刀计划" type="object" name="open_sf_cam_work_order_program_knife_plan"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('loading_task_source', '!=', '0')]}" />
|
|
||||||
<button string="查看机床换刀申请" type="object" name="open_sf_machine_table_tool_changing_apply"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('loading_task_source', '!=', '1')]}" />
|
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -1051,15 +1040,15 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form create="0">
|
<form create="0">
|
||||||
<header>
|
<header>
|
||||||
<button string="组装"
|
<button string="组装"
|
||||||
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
||||||
type="action"
|
type="action"
|
||||||
context="{
|
context="{
|
||||||
'default_machine_tool_name_id': machine_tool_name_id,
|
'default_machine_tool_name_id': machine_tool_name_id,
|
||||||
'default_machine_tool_code': machine_tool_code,
|
'default_machine_tool_code': machine_tool_code,
|
||||||
'default_code': functional_tool_code,
|
'default_barcode_id': barcode_id,
|
||||||
'default_cutter_spacing_code': cutter_spacing_code,
|
'default_cutter_spacing_code': cutter_spacing_code,
|
||||||
'default_functional_tool_name_id': name,
|
'default_functional_tool_name_id': functional_tool_name_id,
|
||||||
'default_functional_tool_type_id': functional_tool_type_id,
|
'default_functional_tool_type_id': functional_tool_type_id,
|
||||||
'default_functional_tool_length': functional_tool_length,
|
'default_functional_tool_length': functional_tool_length,
|
||||||
'default_effective_length': None,
|
'default_effective_length': None,
|
||||||
@@ -1071,39 +1060,33 @@
|
|||||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
|
|
||||||
<button string="取消组装" name="cancel_functional_tool_assembly" type="object"
|
<button string="打印二维码" name="automatic_printing_of_QR_code" type="object"
|
||||||
attrs="{'invisible': [('assemble_status', '!=', '1')]}" class="btn-primary" confirm="是否确认取消组装"/>
|
|
||||||
|
|
||||||
<button string="打印二维码" name="automatic_printing_of_QR_code" type="object"
|
|
||||||
attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印二维码"/>
|
attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印二维码"/>
|
||||||
|
|
||||||
<button string="出库" name="show_popup" type="object"
|
|
||||||
attrs="{'invisible': [('assemble_status', '!=', '1')]}" class="btn-primary"/>
|
|
||||||
|
|
||||||
<button string="组装单打印" name="assemble_single_print" type="object"
|
<button string="组装单打印" name="assemble_single_print" type="object"
|
||||||
attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印组装单"/>
|
attrs="{'invisible': [('assemble_status', '=', '0')]}" class="btn-primary" confirm="是否确认打印组装单"/>
|
||||||
<button string="查看CAM工单程序用刀计划" type="object" name="open_sf_cam_work_order_program_knife_plan"
|
<field name="assemble_status" widget="statusbar" statusbar_visible="0,1,2"/>
|
||||||
class="oe_highlight" attrs="{'invisible': [('loading_task_source', '!=', '0')]}" />
|
|
||||||
<button string="查看机床换刀申请" type="object" name="open_sf_machine_table_tool_changing_apply"
|
|
||||||
class="oe_highlight" attrs="{'invisible': [('loading_task_source', '!=', '1')]}" />
|
|
||||||
<field name="assemble_status" widget="statusbar" statusbar_visible="0,1,2"/>
|
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name"/>
|
<field name="assembly_order_code"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="functional_tool_code" readonly="1"/>
|
<field name="barcode_id"/>
|
||||||
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
<field name="functional_tool_diameter"/>
|
<field name="sf_machine_table_tool_changing_apply_id"
|
||||||
<field name="functional_tool_length"/>
|
attrs="{'invisible': [('sf_machine_table_tool_changing_apply_id','=',False)]}"/>
|
||||||
<field name="functional_tool_cutting_type"/>
|
<field name="sf_cam_work_order_program_knife_plan_id"
|
||||||
<!-- <field name="barcode"/>-->
|
attrs="{'invisible': [('sf_cam_work_order_program_knife_plan_id','=',False)]}"/>
|
||||||
<!-- <field name="barcode_image"/>-->
|
|
||||||
</group>
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="functional_tool_diameter"/>
|
||||||
|
<field name="functional_tool_length"/>
|
||||||
|
<field name="functional_tool_cutting_type"/>
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<notebook>
|
<notebook>
|
||||||
@@ -1127,7 +1110,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group col="1">
|
<group col="1">
|
||||||
<group col="1">
|
<group col="1" attrs="{'invisible': [('handle_code_id', '=', False)]}">
|
||||||
<div>
|
<div>
|
||||||
<separator string="刀柄:" style="font-size: 13px;"/>
|
<separator string="刀柄:" style="font-size: 13px;"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -1165,7 +1148,7 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group col="1">
|
<group col="1">
|
||||||
<group col="1">
|
<group col="1" attrs="{'invisible': [('chuck_code_id', '=', False)]}">
|
||||||
<div>
|
<div>
|
||||||
<separator string="夹头:" style="font-size: 13px;"/>
|
<separator string="夹头:" style="font-size: 13px;"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -1208,35 +1191,6 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="integral_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_integral_model_id"/>-->
|
|
||||||
<!-- <field name="blade_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_blade_model_id"/>-->
|
|
||||||
<!-- <field name="bar_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_cutterbar_model_id"/>-->
|
|
||||||
<!-- <field name="pad_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_cutterpad_model_id"/>-->
|
|
||||||
<!-- <field name="handle_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_cutterhandle_model_id"/>-->
|
|
||||||
<!-- <field name="chuck_code_id"/>-->
|
|
||||||
<!-- <field name="cutting_tool_cutterhead_model_id"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="integral_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_1"/>-->
|
|
||||||
<!-- <field name="blade_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_2"/>-->
|
|
||||||
<!-- <field name="bar_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_3"/>-->
|
|
||||||
<!-- <field name="pad_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_4"/>-->
|
|
||||||
<!-- <field name="handle_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_5"/>-->
|
|
||||||
<!-- <field name="chuck_name"/>-->
|
|
||||||
<!-- <field name="sf_tool_brand_id_6"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page string="申请信息">
|
<page string="申请信息">
|
||||||
@@ -1286,8 +1240,10 @@
|
|||||||
<field name="model">sf.functional.tool.assembly</field>
|
<field name="model">sf.functional.tool.assembly</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="functional_tool_code"/>
|
<!-- <field name="functional_tool_code"/>-->
|
||||||
<field name="name"/>
|
<field name="functional_tool_name_id"/>
|
||||||
|
<field name="assembly_order_code"/>
|
||||||
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
<field name="loading_task_source"/>
|
<field name="loading_task_source"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
|||||||
name = fields.Many2one('maintenance.equipment', string='CNC机床', readonly=True)
|
name = fields.Many2one('maintenance.equipment', string='CNC机床', readonly=True)
|
||||||
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
||||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
# functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True)
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||||
|
|
||||||
replacement_tool_code = fields.Char(string='待换功能刀具编码', readonly=True)
|
# replacement_tool_code = fields.Char(string='待换功能刀具编码', readonly=True)
|
||||||
replacement_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='待换功能刀具名称')
|
replacement_tool_name_id = fields.Many2one('product.product', string='待换功能刀具名称', )
|
||||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型',
|
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型')
|
||||||
readonly=True)
|
|
||||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
||||||
string='粗/中/精')
|
string='粗/中/精')
|
||||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧')
|
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧')
|
||||||
@@ -27,12 +27,6 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
|||||||
reason_for_applying = fields.Char(string='申请原因')
|
reason_for_applying = fields.Char(string='申请原因')
|
||||||
remark = fields.Char(string='备注说明')
|
remark = fields.Char(string='备注说明')
|
||||||
|
|
||||||
@api.onchange('replacement_tool_name_id')
|
|
||||||
def _onchange_replacement_tool_name_id(self):
|
|
||||||
for record in self:
|
|
||||||
if record:
|
|
||||||
record.replacement_tool_code = record.replacement_tool_name_id.code
|
|
||||||
record.replacement_tool_type_id = record.replacement_tool_name_id.mrs_cutting_tool_type_id.id
|
|
||||||
|
|
||||||
def tool_changing_apply(self):
|
def tool_changing_apply(self):
|
||||||
"""
|
"""
|
||||||
@@ -40,16 +34,16 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# 将数据更新到机台换刀申请界面
|
# 将数据更新到机台换刀申请界面
|
||||||
|
print('已运行')
|
||||||
record = self.env['sf.machine.table.tool.changing.apply'].search(
|
record = self.env['sf.machine.table.tool.changing.apply'].search(
|
||||||
[('name', '=', self.name.id),
|
[('name', '=', self.name.id),
|
||||||
('machine_tool_code', '=', self.machine_tool_code),
|
('machine_tool_code', '=', self.machine_tool_code),
|
||||||
('cutter_spacing_code', '=', self.cutter_spacing_code),
|
('cutter_spacing_code', '=', self.cutter_spacing_code),
|
||||||
])
|
])
|
||||||
|
print('运行record_1')
|
||||||
# 功能刀具组装创建新任务(new_assembly_task)
|
# 功能刀具组装创建新任务(new_assembly_task)
|
||||||
record_1 = self.env['sf.functional.tool.assembly'].sudo().create({
|
record_1 = self.env['sf.functional.tool.assembly'].sudo().create({
|
||||||
'functional_tool_code': self.replacement_tool_code,
|
'functional_tool_name_id': self.replacement_tool_name_id.id,
|
||||||
'name': self.replacement_tool_name_id.id,
|
|
||||||
'functional_tool_type_id': self.replacement_tool_type_id.id,
|
'functional_tool_type_id': self.replacement_tool_type_id.id,
|
||||||
'loading_task_source': '1',
|
'loading_task_source': '1',
|
||||||
'applicant': self.applicant,
|
'applicant': self.applicant,
|
||||||
@@ -60,12 +54,13 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
|||||||
'cutter_spacing_code': self.cutter_spacing_code,
|
'cutter_spacing_code': self.cutter_spacing_code,
|
||||||
'sf_machine_table_tool_changing_apply_id': record.id,
|
'sf_machine_table_tool_changing_apply_id': record.id,
|
||||||
})
|
})
|
||||||
|
print('record_1:', record_1)
|
||||||
# 封装数据
|
# 封装数据
|
||||||
desc = {
|
desc = {
|
||||||
'name': self.name.id,
|
'name': self.name.id,
|
||||||
|
'assembly_order_code': record_1.assembly_order_code,
|
||||||
'machine_tool_code': self.machine_tool_code,
|
'machine_tool_code': self.machine_tool_code,
|
||||||
'cutter_spacing_code': self.cutter_spacing_code,
|
'cutter_spacing_code': self.cutter_spacing_code,
|
||||||
'replacement_tool_code': self.replacement_tool_code,
|
|
||||||
'replacement_tool_name_id': self.replacement_tool_name_id.id,
|
'replacement_tool_name_id': self.replacement_tool_name_id.id,
|
||||||
'replacement_tool_type_id': self.replacement_tool_type_id.id,
|
'replacement_tool_type_id': self.replacement_tool_type_id.id,
|
||||||
'replacement_tool_coarse_middle_thin': self.replacement_tool_coarse_middle_thin,
|
'replacement_tool_coarse_middle_thin': self.replacement_tool_coarse_middle_thin,
|
||||||
@@ -77,7 +72,9 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
|||||||
'status': '1',
|
'status': '1',
|
||||||
'sf_functional_tool_assembly_id': record_1.id,
|
'sf_functional_tool_assembly_id': record_1.id,
|
||||||
}
|
}
|
||||||
|
print('运行record.write(desc):')
|
||||||
record.write(desc)
|
record.write(desc)
|
||||||
|
print('运行成功')
|
||||||
|
|
||||||
# 关闭弹出窗口
|
# 关闭弹出窗口
|
||||||
return {'type': 'ir.actions.act_window_close'}
|
return {'type': 'ir.actions.act_window_close'}
|
||||||
@@ -90,8 +87,9 @@ class ToolTransferRequestInformation(models.TransientModel):
|
|||||||
CNC_machine_table_id = fields.Many2one('sf.machine_tool', string='CNC机床', readonly=True)
|
CNC_machine_table_id = fields.Many2one('sf.machine_tool', string='CNC机床', readonly=True)
|
||||||
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
||||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
# functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True)
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||||
transfer_target = fields.Selection([('机台', '机台'),
|
transfer_target = fields.Selection([('机台', '机台'),
|
||||||
('线边刀库', '线边刀库'),
|
('线边刀库', '线边刀库'),
|
||||||
@@ -125,8 +123,9 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
machine_tool_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=True)
|
machine_tool_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=True)
|
||||||
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
||||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
||||||
code = fields.Char(string='功能刀具编码', readonly=True)
|
# code = fields.Char(string='功能刀具编码', readonly=True)
|
||||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号', readonly=True)
|
||||||
|
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称', readonly=True)
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||||
functional_tool_length = fields.Char(string='功能刀具伸出长(mm)', readonly=True)
|
functional_tool_length = fields.Char(string='功能刀具伸出长(mm)', readonly=True)
|
||||||
effective_length = fields.Char(string='有效长(mm)', readonly=True)
|
effective_length = fields.Char(string='有效长(mm)', readonly=True)
|
||||||
@@ -258,7 +257,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
|
|
||||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', default='1')
|
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', default='1')
|
||||||
tool_loading_length = fields.Char(string='装刀长')
|
tool_loading_length = fields.Char(string='装刀长')
|
||||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', required=True, default='1')
|
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', required=True, default='0')
|
||||||
reference_length = fields.Char(string='参考伸出长')
|
reference_length = fields.Char(string='参考伸出长')
|
||||||
cut_time = fields.Char(string='已切削时间')
|
cut_time = fields.Char(string='已切削时间')
|
||||||
cut_length = fields.Char(string='已切削长度')
|
cut_length = fields.Char(string='已切削长度')
|
||||||
@@ -269,31 +268,19 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
功能刀具组装
|
功能刀具组装
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
# 创建组装入库单
|
||||||
|
# 创建功能刀具批次/序列号记录
|
||||||
|
stock_lot = self.create_assemble_warehouse_receipt()
|
||||||
|
# 创建刀具组装入库单
|
||||||
|
self.create_stocking_picking(stock_lot)
|
||||||
desc_1 = {
|
desc_1 = {
|
||||||
'cutting_tool_integral_model_id': self.cutting_tool_integral_model_id.id,
|
'barcode_id': stock_lot.id,
|
||||||
'integral_code_id': self.integral_code_id.id,
|
'integral_code_id': self.integral_code_id.id,
|
||||||
'integral_name': self.integral_name,
|
|
||||||
'sf_tool_brand_id_1': self.sf_tool_brand_id_1,
|
|
||||||
'cutting_tool_blade_model_id': self.cutting_tool_blade_model_id.id,
|
|
||||||
'blade_code_id': self.blade_code_id.id,
|
'blade_code_id': self.blade_code_id.id,
|
||||||
'blade_name': self.blade_name,
|
|
||||||
'sf_tool_brand_id_2': self.sf_tool_brand_id_2,
|
|
||||||
'cutting_tool_cutterbar_model_id': self.cutting_tool_cutterbar_model_id.id,
|
|
||||||
'bar_code_id': self.bar_code_id.id,
|
'bar_code_id': self.bar_code_id.id,
|
||||||
'bar_name': self.bar_name,
|
|
||||||
'sf_tool_brand_id_3': self.sf_tool_brand_id_3,
|
|
||||||
'cutting_tool_cutterpad_model_id': self.cutting_tool_cutterpad_model_id.id,
|
|
||||||
'pad_code_id': self.pad_code_id.id,
|
'pad_code_id': self.pad_code_id.id,
|
||||||
'pad_name': self.pad_name,
|
|
||||||
'sf_tool_brand_id_4': self.sf_tool_brand_id_4,
|
|
||||||
'cutting_tool_cutterhandle_model_id': self.cutting_tool_cutterhandle_model_id.id,
|
|
||||||
'handle_code_id': self.handle_code_id.id,
|
'handle_code_id': self.handle_code_id.id,
|
||||||
'handle_name': self.handle_name,
|
|
||||||
'sf_tool_brand_id_5': self.sf_tool_brand_id_5,
|
|
||||||
'cutting_tool_cutterhead_model_id': self.cutting_tool_cutterhead_model_id.id,
|
|
||||||
'chuck_code_id': self.chuck_code_id.id,
|
'chuck_code_id': self.chuck_code_id.id,
|
||||||
'chuck_name': self.chuck_name,
|
|
||||||
'sf_tool_brand_id_6': self.sf_tool_brand_id_6,
|
|
||||||
'coarse_middle_thin': self.coarse_middle_thin,
|
'coarse_middle_thin': self.coarse_middle_thin,
|
||||||
'tool_loading_length': self.tool_loading_length,
|
'tool_loading_length': self.tool_loading_length,
|
||||||
'new_former': self.new_former,
|
'new_former': self.new_former,
|
||||||
@@ -310,14 +297,10 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
('cutter_spacing_code', '=', self.cutter_spacing_code),
|
('cutter_spacing_code', '=', self.cutter_spacing_code),
|
||||||
('assemble_status', '=', '0'),
|
('assemble_status', '=', '0'),
|
||||||
])
|
])
|
||||||
|
|
||||||
# print('功能刀具组装id:', functional_tool_assembly.id)
|
|
||||||
# print('整体式物料信息:', self.cutting_tool_integral_model_id.id)
|
|
||||||
|
|
||||||
# 封装功能刀具数据
|
# 封装功能刀具数据
|
||||||
desc_2 = {
|
desc_2 = {
|
||||||
'code': self.code,
|
'barcode_id': stock_lot.id,
|
||||||
'name': self.functional_tool_name_id.name,
|
'functional_tool_name_id': self.functional_tool_name_id.id,
|
||||||
'mrs_cutting_tool_type_id': self.functional_tool_type_id.id,
|
'mrs_cutting_tool_type_id': self.functional_tool_type_id.id,
|
||||||
'cutting_tool_integral_model_id': self.cutting_tool_integral_model_id.id,
|
'cutting_tool_integral_model_id': self.cutting_tool_integral_model_id.id,
|
||||||
'cutting_tool_blade_model_id': self.cutting_tool_blade_model_id.id,
|
'cutting_tool_blade_model_id': self.cutting_tool_blade_model_id.id,
|
||||||
@@ -337,105 +320,116 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
'applicable_range': None,
|
'applicable_range': None,
|
||||||
'image': None,
|
'image': None,
|
||||||
}
|
}
|
||||||
if self.new_former == '0':
|
# 创建功能刀具列表、功能刀具预警、功能刀具实时分布、功能刀具出入库记录
|
||||||
record = self.env['sf.functional.cutting.tool.entity'].search([('code', '=', self.code)])
|
record_1 = self.env['sf.functional.cutting.tool.entity'].create(desc_2)
|
||||||
if record:
|
self.env['sf.functional.tool.warning'].create({
|
||||||
raise ValidationError("该编码的功能刀具已存在!")
|
'functional_cutting_tool_id': record_1.id,
|
||||||
else:
|
'functional_tool_assembly_id': functional_tool_assembly.id,
|
||||||
# 如果是新刀,则创建功能刀具列表、功能刀具预警、功能刀具实时分布、功能刀具出入库记录
|
'machine_table_name_id': self.machine_tool_name_id.id,
|
||||||
record_1 = self.env['sf.functional.cutting.tool.entity'].create(desc_2)
|
})
|
||||||
self.env['sf.functional.tool.warning'].create({
|
self.env['sf.real.time.distribution.of.functional.tools'].create({
|
||||||
'functional_cutting_tool_id': record_1.id,
|
'functional_cutting_tool_id': record_1.id
|
||||||
'functional_tool_assembly_id': functional_tool_assembly.id,
|
})
|
||||||
'machine_table_name_id': self.machine_tool_name_id.id,
|
self.env['sf.inbound.and.outbound.records.of.functional.tools'].create({
|
||||||
})
|
'functional_cutting_tool_id': record_1.id
|
||||||
self.env['sf.real.time.distribution.of.functional.tools'].create({
|
})
|
||||||
'functional_cutting_tool_id': record_1.id
|
|
||||||
})
|
|
||||||
self.env['sf.inbound.and.outbound.records.of.functional.tools'].create({
|
|
||||||
'functional_cutting_tool_id': record_1.id
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
record = self.env['sf.functional.cutting.tool.entity'].search([('code', '=', self.code)])
|
|
||||||
if not record:
|
|
||||||
raise ValidationError("该编码的功能刀具不存在!!!")
|
|
||||||
else:
|
|
||||||
# 创建功能刀具缓存信息
|
|
||||||
record1 = self.env['sf.functional.cutting.tool.entity.cache'].create({
|
|
||||||
'code': record.code,
|
|
||||||
'name': record.name,
|
|
||||||
'mrs_cutting_tool_type_id': record.mrs_cutting_tool_type_id.id,
|
|
||||||
'mrs_cutting_tool_model_id': record.mrs_cutting_tool_model_id.id,
|
|
||||||
'cutting_tool_integral_model_id': record.cutting_tool_integral_model_id.id,
|
|
||||||
'cutting_tool_blade_model_id': record.cutting_tool_blade_model_id.id,
|
|
||||||
'cutting_tool_cutterbar_model_id': record.cutting_tool_cutterbar_model_id.id,
|
|
||||||
'cutting_tool_cutterpad_model_id': record.cutting_tool_cutterpad_model_id.id,
|
|
||||||
'cutting_tool_cutterhandle_model_id': record.cutting_tool_cutterhandle_model_id.id,
|
|
||||||
'cutting_tool_cutterhead_model_id': record.cutting_tool_cutterhead_model_id.id,
|
|
||||||
'diameter': record.diameter,
|
|
||||||
'tool_grade': record.tool_grade,
|
|
||||||
'machining_accuracy': record.machining_accuracy,
|
|
||||||
'tool_length': record.tool_length,
|
|
||||||
'blade_number': record.blade_number,
|
|
||||||
'integral_blade_length': record.integral_blade_length,
|
|
||||||
'effective_blade_length': record.effective_blade_length,
|
|
||||||
'max_life': record.max_life,
|
|
||||||
'is_standard': record.is_standard,
|
|
||||||
'applicable_range': record.applicable_range,
|
|
||||||
'image': record.image,
|
|
||||||
})
|
|
||||||
# # 删除功能刀具列表信息
|
|
||||||
# self.env['sf.functional.cutting.tool.entity'].search([('code', '=', self.code)]).unlink()
|
|
||||||
# # 创建功能刀具列表信息
|
|
||||||
# self.env['sf.functional.cutting.tool.entity'].search([('code', '=', self.code)]).create(desc_2)
|
|
||||||
# 修改功能刀具列表信息
|
|
||||||
self.env['sf.functional.cutting.tool.entity'].search([('code', '=', self.code)]).write(desc_2)
|
|
||||||
# 修改功能刀具组装信息
|
# 修改功能刀具组装信息
|
||||||
functional_tool_assembly.write(desc_1)
|
functional_tool_assembly.write(desc_1)
|
||||||
|
|
||||||
|
if functional_tool_assembly.sf_machine_table_tool_changing_apply_id:
|
||||||
|
# 修改机床换刀申请的状态
|
||||||
|
self.env['sf.machine.table.tool.changing.apply'].sudo().search([
|
||||||
|
('id', '=', functional_tool_assembly.sf_machine_table_tool_changing_apply_id.id)
|
||||||
|
]).write({'status': '3'})
|
||||||
|
elif functional_tool_assembly.sf_cam_work_order_program_knife_plan_id:
|
||||||
|
# 修改CAM工单程序用刀计划状态
|
||||||
|
self.env['sf.cam.work.order.program.knife.plan'].sudo().search([
|
||||||
|
('id', '=', functional_tool_assembly.sf_cam_work_order_program_knife_plan_id.id)
|
||||||
|
]).write({'plan_execute_status': '2'})
|
||||||
|
|
||||||
# 关闭弹出窗口
|
# 关闭弹出窗口
|
||||||
return {'type': 'ir.actions.act_window_close'}
|
return {'type': 'ir.actions.act_window_close'}
|
||||||
|
|
||||||
|
def create_stocking_picking(self, stock_lot):
|
||||||
class DeliveryOfCargoFromStorage(models.TransientModel):
|
|
||||||
_name = 'sf.delivery.of.cargo.from.storage'
|
|
||||||
_description = '出库'
|
|
||||||
|
|
||||||
order = fields.Integer(string='序')
|
|
||||||
functional_tool_code = fields.Char(string='功能刀具编码')
|
|
||||||
name = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称')
|
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
|
||||||
production_line_name_id = fields.Many2one('sf.production.line', string='产线名称')
|
|
||||||
machine_tool_code = fields.Char(string='机台号')
|
|
||||||
receive_person = fields.Char(string='领用人')
|
|
||||||
receive_time = fields.Datetime(string='领用出库时间')
|
|
||||||
|
|
||||||
def stock_removal(self):
|
|
||||||
"""
|
"""
|
||||||
出库
|
创建刀具组装入库单
|
||||||
:return:
|
|
||||||
"""
|
"""
|
||||||
vals = self.env['sf.delivery.of.cargo.from.storage'].search([])
|
# 获取名称为刀具组装入库的作业类型
|
||||||
if vals:
|
picking_type_id = self.env['stock.picking.type'].sudo().search([('name', '=', '刀具组装入库')])
|
||||||
for val in vals:
|
# 创建刀具组装入库单
|
||||||
# 删除功能刀具列表缓存的数据
|
picking_id = self.env['stock.picking'].create({
|
||||||
self.env['sf.functional.cutting.tool.entity.cache'].search([
|
'picking_type_id': picking_type_id.id
|
||||||
('code', '=', self.functional_tool_code)]).unlink()
|
})
|
||||||
|
# 创建作业详情对象记录,并绑定到刀具组装入库单
|
||||||
|
self.env['stock.move.line'].create({
|
||||||
|
'picking_id': picking_id.id,
|
||||||
|
'product_id': stock_lot.product_id.id,
|
||||||
|
'lot_id': stock_lot.id
|
||||||
|
})
|
||||||
|
# 将刀具组装入库单的状态更改为就绪
|
||||||
|
picking_id.action_confirm()
|
||||||
|
|
||||||
record = self.env['sf.functional.tool.assembly'].search([
|
def create_assemble_warehouse_receipt(self):
|
||||||
('functional_tool_code', '=', val.functional_tool_code),
|
"""
|
||||||
('assemble_status', '=', '1')
|
创建功能刀具批次/序列号记录
|
||||||
])
|
"""
|
||||||
# 判断装刀任务来源,如果来源于CAM装刀,则修改CAM装刀的计划执行状态
|
product_id = self.env['product.product'].search([('name', '=', '功能刀具')])
|
||||||
if record.loading_task_source == '0':
|
|
||||||
self.env['sf.cam.work.order.program.knife.plan'].search([
|
|
||||||
('functional_tool_code', '=', val.functional_tool_code),
|
|
||||||
('functional_tool_name_id', '=', val.name.id)
|
|
||||||
]).write({
|
|
||||||
'plan_execute_status': '2'
|
|
||||||
})
|
|
||||||
|
|
||||||
record.write({
|
stock_lot = self.env['stock.lot'].create({
|
||||||
'assemble_status': '2',
|
'name': self.get_stock_lot_name(),
|
||||||
'receive_person': self.env.user.name,
|
'product_id': product_id.id,
|
||||||
'receive_time': fields.Datetime.now()
|
'company_id': self.env.company.id
|
||||||
})
|
})
|
||||||
|
# 创建功能刀具该批次/序列号 库存移动和移动历史
|
||||||
|
self.create_stock_quant(product_id, stock_lot)
|
||||||
|
|
||||||
|
return stock_lot
|
||||||
|
|
||||||
|
def create_stock_quant(self, product_id, stock_lot):
|
||||||
|
"""
|
||||||
|
创建功能刀具该批次/序列号 库存移动和移动历史
|
||||||
|
"""
|
||||||
|
# 获取位置对象
|
||||||
|
stock_location_id = self.env['stock.location'].search([('name', '=', '组装后')])
|
||||||
|
location_inventory_id = self.env['stock.location'].search([('name', '=', 'Inventory adjustment')])
|
||||||
|
|
||||||
|
# 创建库存移动
|
||||||
|
stock_move_id = self.env['stock.move'].create({
|
||||||
|
'name': '更新的产品数量',
|
||||||
|
'product_id': product_id.id,
|
||||||
|
'location_id': location_inventory_id.id,
|
||||||
|
'location_dest_id': stock_location_id.id,
|
||||||
|
'product_uom_qty': 1.00,
|
||||||
|
'state': 'done'
|
||||||
|
})
|
||||||
|
|
||||||
|
# 创建移动历史
|
||||||
|
stock_move_line_id = self.env['stock.move.line'].create({
|
||||||
|
'product_id': product_id.id,
|
||||||
|
'lot_id': stock_lot.id,
|
||||||
|
'move_id': stock_move_id.id,
|
||||||
|
'qty_done': 1.0,
|
||||||
|
'state': 'done'
|
||||||
|
})
|
||||||
|
|
||||||
|
return stock_move_id, stock_move_line_id
|
||||||
|
|
||||||
|
def get_stock_lot_name(self):
|
||||||
|
"""
|
||||||
|
生成功能刀具序列号
|
||||||
|
"""
|
||||||
|
code = 'JKM-T-' + str(self.functional_tool_type_id.code) + '-' + str(self.functional_tool_diameter) + '-'
|
||||||
|
new_time = fields.Date.today()
|
||||||
|
code += str(new_time) + '-'
|
||||||
|
stock_lot_id = self.env['stock.lot'].sudo().search(
|
||||||
|
[('name', 'like', new_time), ('product_id.name', '=', '功能刀具')],
|
||||||
|
limit=1,
|
||||||
|
order="id desc"
|
||||||
|
)
|
||||||
|
if not stock_lot_id:
|
||||||
|
num = "%03d" % 1
|
||||||
|
else:
|
||||||
|
m = int(stock_lot_id.name[-3:]) + 1
|
||||||
|
num = "%03d" % m
|
||||||
|
return code + str(num)
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<group string="机床信息" col="3">
|
<group string="机床信息" col="3">
|
||||||
<group>
|
<group>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="functional_tool_code"/>
|
<field name="barcode_id"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="machine_tool_code"/>
|
<field name="machine_tool_code"/>
|
||||||
@@ -29,11 +29,9 @@
|
|||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="replacement_tool_code"/>
|
|
||||||
<field name="used_tool_time" placeholder="请选择"/>
|
<field name="used_tool_time" placeholder="请选择"/>
|
||||||
<field name="new_former" placeholder="请选择"/>
|
<field name="new_former" placeholder="请选择"/>
|
||||||
<field name="reason_for_applying"/>
|
<field name="reason_for_applying"/>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
@@ -77,7 +75,7 @@
|
|||||||
<field name="functional_tool_type_id" string="功能刀具类型"/>
|
<field name="functional_tool_type_id" string="功能刀具类型"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="functional_tool_code" string="功能刀具编码"/>
|
<field name="barcode_id" string="功能刀具编码"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string="刀具转移">
|
<group string="刀具转移">
|
||||||
@@ -125,7 +123,7 @@
|
|||||||
<group string="功能刀具申请信息">
|
<group string="功能刀具申请信息">
|
||||||
<group>
|
<group>
|
||||||
<field name="machine_tool_name_id"/>
|
<field name="machine_tool_name_id"/>
|
||||||
<field name="code"/>
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="functional_tool_length"/>
|
<field name="functional_tool_length"/>
|
||||||
<field name="effective_length"/>
|
<field name="effective_length"/>
|
||||||
@@ -306,38 +304,4 @@
|
|||||||
<field name="view_id" ref="sf_functional_tool_assembly_order_form"/>
|
<field name="view_id" ref="sf_functional_tool_assembly_order_form"/>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--================================================出库================================================-->
|
|
||||||
<record id="sf_delivery_of_cargo_from_storager_tree" model="ir.ui.view">
|
|
||||||
<field name="name">出库</field>
|
|
||||||
<field name="model">sf.delivery.of.cargo.from.storage</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<tree>
|
|
||||||
<field name="order"/>
|
|
||||||
<field name="functional_tool_code"/>
|
|
||||||
<field name="name"/>
|
|
||||||
<field name="functional_tool_type_id"/>
|
|
||||||
<field name="production_line_name_id"/>
|
|
||||||
<field name="machine_tool_code"/>
|
|
||||||
<field name="receive_person"/>
|
|
||||||
<field name="receive_time"/>
|
|
||||||
|
|
||||||
<button string="确定" name="stock_removal" type="object" class="btn-primary" />
|
|
||||||
<button string="取消" class="btn-secondary" special="cancel"/>
|
|
||||||
|
|
||||||
</tree>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="sf_delivery_of_cargo_from_storager_act" model="ir.actions.act_window">
|
|
||||||
<field name="name">出库</field>
|
|
||||||
<field name="type">ir.actions.act_window</field>
|
|
||||||
<field name="res_model">sf.delivery.of.cargo.from.storage</field>
|
|
||||||
<field name="view_mode">tree</field>
|
|
||||||
<field name="view_id" ref="sf_delivery_of_cargo_from_storager_tree"/>
|
|
||||||
<field name="target">new</field>
|
|
||||||
</record>
|
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -237,4 +237,6 @@ class SfProcurementGroup(models.Model):
|
|||||||
for res1 in res_list:
|
for res1 in res_list:
|
||||||
if product_id.categ_id in res1.location_dest_id.product_type:
|
if product_id.categ_id in res1.location_dest_id.product_type:
|
||||||
res = res1
|
res = res1
|
||||||
|
if not res:
|
||||||
|
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]), order='route_sequence, sequence', limit=1)
|
||||||
return res
|
return res
|
||||||
Reference in New Issue
Block a user