Commit 3e5c45a5 by guibin

添加车间工作时间配置

parent 73acc600
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
{ {
'name': "tht_project", 'name': "融科-天合堂",
'summary': """ 'summary': """
Short (1 phrase/line) summary of the module's purpose, used as Short (1 phrase/line) summary of the module's purpose, used as
...@@ -20,13 +20,15 @@ ...@@ -20,13 +20,15 @@
'version': '0.1', 'version': '0.1',
# any module necessary for this one to work correctly # any module necessary for this one to work correctly
'depends': ['base'], 'depends': ['roke_mes_three_colour_light'],
# always loaded # always loaded
'data': [ 'data': [
# 'security/ir.model.access.csv', # 'security/ir.model.access.csv',
'views/views.xml', 'views/views.xml',
'views/templates.xml', 'views/templates.xml',
'views/plant_working_time_config.xml',
'views/menus.xml',
], ],
# only loaded in demonstration mode # only loaded in demonstration mode
'demo': [ 'demo': [
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from . import models from . import models
\ No newline at end of file from . import plant_working_time_config
\ No newline at end of file
from odoo import api, fields, models
class PlantWorkingTimeConfig(models.Model):
_name = "plant.working.time.config"
_description = "车间工作时间配置"
plant_id = fields.Many2one("roke.plant", string="车间")
start_time = fields.Float(string="开始时间", default="0")
end_time = fields.Float(string="结束时间", default="0")
color = fields.Selection([
('red', '红'),
('yellow', '黄'),
('green', '绿'),
('blue', '蓝'),
('gray', '灰')
], string="颜色")
wait_time = fields.Float(string="等待时间")
\ No newline at end of file
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_tht_project_tht_project,tht_project.tht_project,model_tht_project_tht_project,base.group_user,1,1,1,1 access_plant_working_time_config_group_user,plant_working_time_config group_user,model_plant_working_time_config,base.group_user,1,1,1,1
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="menu_plant_working_time_config" name="车间工作时间配置"
action="tht_project.action_plant_working_time_config"
parent="roke_mes_three_colour_light.roke_three_color_light_iframe_device_monitor_menu"
sequence="40"
groups="base.group_system"
/>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_plant_working_time_config_tree" model="ir.ui.view">
<field name="name">view_plant_working_time_config_tree</field>
<field name="model">plant.working.time.config</field>
<field name="arch" type="xml">
<tree>
<field name="plant_id"/>
<field name="start_time" widget="float_time"/>
<field name="end_time" widget="float_time"/>
</tree>
</field>
</record>
<record id="view_plant_working_time_config_form" model="ir.ui.view">
<field name="name">view_plant_working_time_config_form</field>
<field name="model">plant.working.time.config</field>
<field name="arch" type="xml">
<form>
<group col="3">
<group>
<field name="plant_id"/>
</group>
<group>
<field name="start_time" widget="float_time"/>
</group>
<group>
<field name="end_time" widget="float_time"/>
</group>
</group>
<notebook>
<page string="停机规则设置">
<div class="mb16" style="display: flex; flex-direction: row; align-items: center;">
<div class="ml16" style="width: 150px">
<field name="color"/>
</div>
<span class="ml16">色下连续超过</span>
<div class="ml16" style="width: 150px">
<field name="wait_time"/>
</div>
<span class="ml16">分钟,页面展示停机状态。</span>
</div>
</page>
</notebook>
</form>
</field>
</record>
<record id="action_plant_working_time_config" model="ir.actions.act_window">
<field name="name">车间工作时间配置</field>
<field name="res_model">plant.working.time.config</field>
<field name="view_mode">tree,form</field>
<field name="type">ir.actions.act_window</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
</odoo>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment