设备维保
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import models
|
||||
@@ -1,34 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫智能工厂 刀具管理',
|
||||
'version': '1.0',
|
||||
'summary': '智能工厂刀具管理',
|
||||
'sequence': 1,
|
||||
'description': """
|
||||
在本模块,定义了主要的角色、菜单、基础业务对象
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'sf_base', 'mrp'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/tool_base_views.xml',
|
||||
'views/menu_view.xml',
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'assets': {
|
||||
|
||||
'web.assets_qweb': [
|
||||
],
|
||||
|
||||
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
from . import base
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class FunctionalCuttingToolEntity(models.Model):
|
||||
_name = 'sf.functional.cutting.tool.entity'
|
||||
_inherit = 'sf.functional.cutting.tool'
|
||||
_description = '功能刀具管理'
|
||||
|
||||
order = fields.Char(string='序')
|
||||
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具', invisible=True)
|
||||
# 功能刀具预警 特有字段
|
||||
install_tool_time = fields.Char("装刀时间")
|
||||
outbound_time = fields.Char('出库时间')
|
||||
on_board_time = fields.Char('上机时间')
|
||||
machine_tool_code = fields.Char('机台号')
|
||||
cutting_tool_code = fields.Char('刀位号')
|
||||
idle_time = fields.Char('闲置时长')
|
||||
alarm_value = fields.Char('报警值')
|
||||
used_value = fields.Char('已使用值')
|
||||
alarm_type = fields.Char('报警类型')
|
||||
alarm_time = fields.Char('报警时间')
|
||||
dispose_user = fields.Char('处理人')
|
||||
dispose_time = fields.Char('处理时间')
|
||||
dispose_func = fields.Char('处理方法/措施')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
# 功能刀具出入库记录 特有字段
|
||||
thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '细')], string='粗/中/细')
|
||||
max_life_span = fields.Char(string='最大寿命值')
|
||||
# alarm_value = fields.Char(string='报警值')
|
||||
# used_value = fields.Char(string='已使用值')
|
||||
current_state = fields.Char(string='当前状态')
|
||||
current_store_area = fields.Char(string='当前库区')
|
||||
current_store_place = fields.Char(string='当前库位')
|
||||
number = fields.Integer(string='数量')
|
||||
reason_application = fields.Char(string='申请原因')
|
||||
applicant = fields.Char(string='申请人')
|
||||
return_staff = fields.Char(string='归还人')
|
||||
return_time = fields.Date(string='归还入库时间')
|
||||
tool_state = fields.Char(string="刀具状态")
|
||||
tool_install_staff = fields.Char(string='装刀人')
|
||||
tool_install_time = fields.Datetime(string='装刀时间')
|
||||
receive_equipment = fields.Char(string='领用机台')
|
||||
receive_staff = fields.Char(string='领用人')
|
||||
receive_time = fields.Char(string='领用出库时间')
|
||||
# remark = fields.Text(string='备注/说明')
|
||||
|
||||
# 功能刀具实时分布
|
||||
tool_stock_num = fields.Text(string='刀具房库存数量')
|
||||
side_shelf_num = fields.Text(string='线边货架货架数量')
|
||||
on_tool_stock_num = fields.Text(string='机内刀库库存数量')
|
||||
tool_stock_total = fields.Text(string='合计')
|
||||
return_reuse_num_re = fields.Text(string='归还再用数量(精)')
|
||||
return_reuse_num_co = fields.Text(string='归还再用数量(粗)')
|
||||
return_processing_num = fields.Text(string='归还需磨削数量')
|
||||
return_total = fields.Text(string='合计')
|
||||
total = fields.Text(string='总计')
|
||||
# remark = fields.Text(string='备注/说明')
|
||||
|
||||
# @api.onchange('functional_cutting_tool_id')
|
||||
# def get_functional_cutting_tool_info(self):
|
||||
# for item in self:
|
||||
# item.code = item.functional_cutting_tool_id.code,
|
||||
# item.name = item.functional_cutting_tool_id.name,
|
||||
# item.functional_model_number = item.functional_cutting_tool_id.functional_model_number,
|
||||
# item.integral_model_number = item.functional_cutting_tool_id.integral_model_number,
|
||||
# item.blade_model_number = item.functional_cutting_tool_id.blade_model_number,
|
||||
# item.cutterbar_model_number = item.functional_cutting_tool_id.cutterbar_model_number,
|
||||
# item.cutterpad_model_number = item.functional_cutting_tool_id.cutterpad_model_number,
|
||||
# item.handle_model_number = item.functional_cutting_tool_id.handle_model_number,
|
||||
# item.chuck_model_number = item.functional_cutting_tool_id.chuck_model_number,
|
||||
# item.diameter = item.functional_cutting_tool_id.diameter,
|
||||
# item.tool_grade = item.functional_cutting_tool_id.tool_grade,
|
||||
# item.machining_accuracy = item.functional_cutting_tool_id.machining_accuracy,
|
||||
# item.ctool_lengthode = item.functional_cutting_tool_id.tool_length,
|
||||
# item.blade_number = item.functional_cutting_tool_id.blade_number,
|
||||
# item.integral_blade_length = item.functional_cutting_tool_id.integral_blade_length,
|
||||
# item.effective_blade_length = item.functional_cutting_tool_id.effective_blade_length,
|
||||
# item.max_life = item.functional_cutting_tool_id.max_life,
|
||||
# item.is_standard = item.functional_cutting_tool_id.is_standard,
|
||||
# item.applicable_range = item.functional_cutting_tool_id.applicable_range,
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
||||
if not vals.get('order'):
|
||||
vals['order'] = self._generate_code()
|
||||
return super(FunctionalCuttingToolEntity, self).create(vals)
|
||||
|
||||
@api.model
|
||||
def _generate_code(self):
|
||||
last_tool = self.search([], order='id desc', limit=1)
|
||||
if last_tool:
|
||||
last_code = int(last_tool.code.split('-')[-1])
|
||||
new_code = '{:03d}'.format(last_code + 1)
|
||||
else:
|
||||
new_code = '001'
|
||||
return new_code
|
||||
@@ -1,4 +0,0 @@
|
||||
<odoo>
|
||||
<data>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,7 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="action_sf_functional_cutting_tool_warning" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具预警</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<menuitem id="menu_sf_tool_manage"
|
||||
name="刀具管理"
|
||||
groups="mrp.group_mrp_routings"
|
||||
parent="mrp.menu_mrp_root"
|
||||
sequence="20"/>
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool"
|
||||
parent="menu_sf_tool_manage"
|
||||
name="功能刀具列表"
|
||||
sequence="3"
|
||||
action="sf_function_tool_entry_list_view_act"
|
||||
/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool_warning"
|
||||
parent="menu_sf_tool_manage"
|
||||
name="功能刀具预警"
|
||||
sequence="4"
|
||||
action="sf_function_tool_entry_warning_view_act"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
sequence="6"
|
||||
name="功能刀具实时分布"
|
||||
id="menu_sf_functional_tool_real_time_distribution"
|
||||
action="sf_functional_tool_real_time_distribution_view_act"
|
||||
parent="menu_sf_tool_manage"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
sequence="10"
|
||||
name="功能刀具出入库记录"
|
||||
id="menu_sf_function_tool_entry_exit_records"
|
||||
action="sf_function_tool_entry_exit_records_view_act"
|
||||
parent="menu_sf_tool_manage"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,193 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- 功能刀具列表tree view -->
|
||||
<record id="view_functional_cutting_tool_list_tree" model="ir.ui.view">
|
||||
<field name="name">sf.functional.cutting.tool.entity.list.tree</field>
|
||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="功能刀具">
|
||||
<field name="code" />
|
||||
<field name="name" />
|
||||
<field name="functional_model_number" />
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number" optional="hide"/>
|
||||
<field name="cutterbar_model_number" optional="hide"/>
|
||||
<field name="cutterpad_model_number" optional="hide"/>
|
||||
<field name="handle_model_number" optional="hide"/>
|
||||
<field name="chuck_model_number" optional="hide"/>
|
||||
<field name="diameter" optional="show"/>
|
||||
<field name="tool_grade" optional="show"/>
|
||||
<field name="machining_accuracy" optional="hide"/>
|
||||
<field name="tool_length" optional="show"/>
|
||||
<field name="blade_number" optional="show"/>
|
||||
<field name="integral_blade_length" optional="show"/>
|
||||
<field name="effective_blade_length" optional="show"/>
|
||||
<field name="max_life" optional="show"/>
|
||||
<field name="is_standard" optional="show"/>
|
||||
<field name="applicable_range" optional="show"/>
|
||||
<field name="image" widget='image' optional="show"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_function_tool_entry_list_view_act" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具列表</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_functional_cutting_tool_list_tree"/>
|
||||
</record>
|
||||
|
||||
<!-- 功能刀具预警tree view -->
|
||||
<record id="view_functional_cutting_tool_warning_tree" model="ir.ui.view">
|
||||
<field name="name">sf.functional.cutting.tool.entity.tree</field>
|
||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="功能刀具">
|
||||
<field name="code" />
|
||||
<field name="name" />
|
||||
<field name="functional_model_number" />
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number" optional="hide"/>
|
||||
<field name="cutterbar_model_number" optional="hide"/>
|
||||
<field name="cutterpad_model_number" optional="hide"/>
|
||||
<field name="handle_model_number" optional="hide"/>
|
||||
<field name="chuck_model_number" optional="hide"/>
|
||||
<field name="install_tool_time" optional="show"/>
|
||||
<field name="outbound_time" optional="show"/>
|
||||
<field name="machining_accuracy" optional="hide"/>
|
||||
<field name="on_board_time" optional="show"/>
|
||||
<field name="machine_tool_code" optional="show"/>
|
||||
<field name="cutting_tool_code" optional="show"/>
|
||||
<field name="idle_time" optional="show"/>
|
||||
<field name="alarm_value" optional="show"/>
|
||||
<field name="used_value" optional="show"/>
|
||||
<field name="alarm_type" optional="show"/>
|
||||
<field name="alarm_time" optional="show"/>
|
||||
<field name="dispose_user" optional="show"/>
|
||||
<field name="dispose_time" optional="show"/>
|
||||
<field name="dispose_func" optional="show"/>
|
||||
<field name="remark" optional="show"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_function_tool_entry_warning_view_act" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具预警</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_functional_cutting_tool_warning_tree"/>
|
||||
</record>
|
||||
|
||||
<!-- ========================================功能刀具出入库记录================================================================== -->
|
||||
<record id="sf_function_tool_entry_exit_records_view_tree" model="ir.ui.view">
|
||||
<field name="name">功能刀具出入库记录</field>
|
||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="functional_model_number"/>
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number" optional="hide"/>
|
||||
<field name="cutterbar_model_number" optional="hide"/>
|
||||
<field name="cutterpad_model_number" optional="hide"/>
|
||||
<field name="handle_model_number" optional="hide"/>
|
||||
<field name="chuck_model_number" optional="hide"/>
|
||||
<field name="diameter" optional="hide"/>
|
||||
<field name="tool_grade" optional="hide"/>
|
||||
<field name="machining_accuracy" optional="hide"/>
|
||||
<field name="tool_length" optional="hide"/>
|
||||
<field name="blade_number" optional="hide"/>
|
||||
<field name="integral_blade_length" optional="hide"/>
|
||||
<field name="effective_blade_length" optional="hide"/>
|
||||
<field name="max_life" optional="hide"/>
|
||||
<field name="is_standard" optional="hide"/>
|
||||
<field name="applicable_range" optional="hide"/>
|
||||
<field name="thickness" optional="show"/>
|
||||
<field name="max_life_span" optional="show"/>
|
||||
<field name="alarm_value" optional="show"/>
|
||||
<field name="used_value" optional="show"/>
|
||||
<field name="current_state" optional="show"/>
|
||||
<field name="current_store_area" optional="show"/>
|
||||
<field name="current_store_place" optional="show"/>
|
||||
<field name="number" optional="show"/>
|
||||
<field name="reason_application" optional="show"/>
|
||||
<field name="applicant" optional="show"/>
|
||||
<field name="return_staff" optional="show"/>
|
||||
<field name="return_time" optional="show"/>
|
||||
<field name="tool_state" optional="show"/>
|
||||
<field name="tool_install_staff" optional="show"/>
|
||||
<field name="tool_install_time" optional="show"/>
|
||||
<field name="receive_equipment" optional="show"/>
|
||||
<field name="receive_staff" optional="show"/>
|
||||
<field name="receive_time" optional="show"/>
|
||||
<field name="remark" optional="show"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_function_tool_entry_exit_records_view_act" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具出入库记录</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="sf_function_tool_entry_exit_records_view_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- =====================================功能刀具实时分布============================================================= -->
|
||||
<record id="sf_functional_tool_real_time_distribution_view_tree" model="ir.ui.view">
|
||||
<field name="name">功能刀具实时分布</field>
|
||||
<field name="model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="functional_model_number"/>
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number" optional="hide"/>
|
||||
<field name="cutterbar_model_number" optional="hide"/>
|
||||
<field name="cutterpad_model_number" optional="hide"/>
|
||||
<field name="handle_model_number" optional="hide"/>
|
||||
<field name="chuck_model_number" optional="hide"/>
|
||||
<field name="diameter" optional="hide"/>
|
||||
<field name="tool_grade" optional="hide"/>
|
||||
<field name="machining_accuracy" optional="hide"/>
|
||||
<field name="tool_length" optional="hide"/>
|
||||
<field name="blade_number" optional="hide"/>
|
||||
<field name="integral_blade_length" optional="hide"/>
|
||||
<field name="effective_blade_length" optional="hide"/>
|
||||
<field name="max_life" optional="hide"/>
|
||||
<field name="is_standard" optional="hide"/>
|
||||
<field name="applicable_range" optional="hide"/>
|
||||
<field name="tool_stock_num" optional="show"/>
|
||||
<field name="side_shelf_num" optional="show"/>
|
||||
<field name="on_tool_stock_num" optional="show"/>
|
||||
<field name="tool_stock_total" optional="show"/>
|
||||
<field name="return_reuse_num_re" optional="show"/>
|
||||
<field name="return_reuse_num_co" optional="show"/>
|
||||
<field name="return_processing_num" optional="show"/>
|
||||
<field name="return_total" optional="show"/>
|
||||
<field name="total" optional="show"/>
|
||||
<field name="remark" optional="show"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_functional_tool_real_time_distribution_view_act" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具实时分布</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.entity</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="sf_functional_tool_real_time_distribution_view_tree"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user