Files
test/sf_plan/views/view.xml
2025-05-19 08:54:02 +08:00

414 lines
24 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="sf_production_plan_tree" model="ir.ui.view">
<field name="name">sf.production.plan.tree</field>
<field name="model">sf.production.plan</field>
<field name="arch" type="xml">
<!-- <tree string="订单计划" editable="bottom"> -->
<tree string="订单计划">
<header>
<!-- <button name="do_production_schedule" type="object" string="批量排程"/> -->
<button string="批量排程" name="%(sf_plan.action_plan_some)d" type="action"
class="treeHeaderBtn"/>
</header>
<field name="state" widget="badge" decoration-warning="state == 'draft'"
decoration-success="state == 'done'" decoration-info="state == 'processing'"
decoration-danger="state == 'finished'"/>
<field name="name"/>
<field name="origin"/>
<field name="part_number" optional="show"/>
<field name="part_name" optional="hide"/>
<field name="order_deadline" widget="date"/>
<field name="product_qty"/>
<field name="production_line_id"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'"
decoration-success="production_type == '自动化产线加工'"/>
<field name="actual_start_time" optional='hide'/>
<field name="actual_end_time" optional='hide'/>
<field name="actual_process_time" optional='hide'/>
<field name="schedule_setting" optional='hide'/>
<!-- <button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object" -->
<!-- attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('actual_start_time', '!=', False)]}" -->
<!-- groups="sf_base.group_plan_dispatch"/> -->
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程"
type="object"
attrs="{'invisible': ['|', ('state', '!=', 'done'), ('actual_start_time', '!=', False)]}"
groups="sf_base.group_plan_dispatch"/>
</tree>
</field>
</record>
<record id="sf_production_plan_form" model="ir.ui.view">
<field name="name">sf.production.plan.form</field>
<field name="model">sf.production.plan</field>
<field name="arch" type="xml">
<form string="订单计划">
<header>
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"
options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'
groups="sf_base.group_plan_dispatch"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('actual_start_time', '!=', False)]}"/>
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"
groups="sf_base.group_plan_dispatch"
attrs="{'invisible': ['|', ('state', '!=', 'done'), ('actual_start_time', '!=', False)]}"/>
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
<field name="state" widget="statusbar" statusbar_visible="draft,done,processing,finished"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="基本信息">
<!-- <field name="active" invisible="1"/> -->
<field name="production_id" widget="many2one_button"/>
<field name="product_id"/>
<field name="origin"/>
<field name="product_qty"/>
<field name="order_deadline" widget="date"/>
<!-- <field name="process_time"/> -->
<field name="schedule_setting"/>
<field name="production_line_id" domain="[('name', 'ilike', 'CNC')]"/>
<!-- Chatter -->
<!-- <div class="oe_chatter"> -->
<!-- <field name="message_follower_ids" widget="mail_followers"/> -->
<!-- <field name="message_ids" widget="mail_thread"/> -->
<!-- <field name="activity_ids"/> -->
<!-- </div> -->
<!-- <div class="oe_chatter"> -->
<!-- <field name="message_follower_ids"/> -->
<!-- <field name="message_ids"/> -->
<!-- </div> -->
</group>
<group string="加工信息">
<field name="date_planned_start"
placeholder="如果不选择计划开始时间,会取当前时间来做排程" required="1"/>
<field name="date_planned_finished" required="0" invisible="1"/>
<field name="actual_process_time"/>
<field name="actual_start_time"/>
<field name="actual_end_time"/>
<field name="state"/>
<field name="shift" widget="time"/>
<!-- Chatter -->
<!-- <div class="oe_chatter"> -->
<!-- <field name="message_follower_ids" widget="mail_followers"/> -->
<!-- <field name="message_ids" widget="mail_thread"/> -->
<!-- <field name="activity_ids"/> -->
<!-- </div> -->
</group>
<!-- <group string="规格信息" col="1"> -->
<!-- <group col="3"> -->
<!-- <group> -->
<!-- <field name="length"/> -->
<!-- </group> -->
<!-- <group> -->
<!-- <field name="width"/> -->
<!-- </group> -->
<!-- <group> -->
<!-- <field name="thickness"/> -->
<!-- </group> -->
<!-- </group> -->
<!-- <field name="length"/> -->
<!-- <field name="width"/> -->
<!-- <field name="thickness"/> -->
<!-- <group> -->
<!-- <field name="diameter"/> -->
<!-- <field name="material"/> -->
<!-- </group> -->
<!-- </group> -->
<!-- <group string="绑定订单"> -->
<!-- <field name="customer_name"/> -->
<!-- <field name="order_no"/> -->
<!-- <field name="line_no"/> -->
<!-- <field name="delivery_length"/> -->
<!-- <field name="delivery_width"/> -->
<!-- <field name="delivery_thickness"/> -->
<!-- <field name="delivery_diameter"/> -->
<!-- <field name="delivery_quantity"/> -->
<!-- <field name="delivery_date"/> -->
<!-- </group> -->
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- 搜索视图 -->
<record id="sf_production_plan_search" model="ir.ui.view">
<field name="name">sf.production.plan.search</field>
<field name="model">sf.production.plan</field>
<field name="arch" type="xml">
<search string="订单计划">
<!-- Your other filters go here -->
<!-- <filter name="archived" string="已归档" domain="[('active','=',False)]"/> -->
<!-- <filter name="not archived" string="未归档" domain="[('active','=',True)]"/> -->
<field name="name"/>
<field name="origin"/>
<field name="part_name"/>
<field name="part_number"/>
<field name="order_deadline" filter_domain="[('order_deadline', 'ilike', self)]"/>
<field name="production_line_id"/>
<field name="model_id"/>
<filter string="待排程" name="draft" domain="[('state','=','draft')]"/>
<filter string="已排程" name="done" domain="[('state','=','done')]"/>
<filter string="加工中" name="processing" domain="[('state','=','processing')]"/>
<filter string="已完成" name="finished" domain="[('state','=','finished')]"/>
<group expand="0" string="Group By">
<filter name="group_by_state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
</group>
<group expand="0" string="Group By">
<filter name="group_by_production_line_id" string="生产线" domain="[]"
context="{'group_by': 'production_line_id'}"/>
</group>
<searchpanel>
<!-- <field name="state" icon="fa-filter"/> -->
<field name="production_line_id" select="multi" string="生产线" icon="fa-building"
enable_counters="1"/>
<field name="state" select="multi" string="状态" icon="fa-building" enable_counters="1"/>
<field name="production_type" select="multi" string="制造类型" icon="fa-building"
enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>
<record id="sf_production_plan_gantt" model="ir.ui.view">
<field name="name">sf.production.plan.gantt</field>
<field name="model">sf.production.plan</field>
<field name="arch" type="xml">
<gantt class="o_mrp_workorder_gantt" date_stop="date_planned_finished" date_start="date_planned_start"
string="制造订单生产计划" default_group_by="production_line_id" create="0"
delete="0" sample="1"
display_unavailability="1"
color="production_line_id"
decoration-success="state == 'done'"
progress_bar="name"
form_view_id="sf_production_plan_form"
default_scale="day"
scales="day,week,month,year"
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
<field name="shift"/>
<field name="name"/>
<field name="product_qty"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="state"/>
<field name="origin"/>
<field name="order_deadline"/>
<field name="product_id"/>
<templates>
<div t-name="gantt-popover" class="container-fluid">
<div class="row g-0">
<div class="col">
<ul class="ps-1 mb-0 list-unstyled">
<li>
<strong>销售订单号:</strong>
<t t-out="origin"/>
</li>
<li>
<strong>制造订单号:</strong>
<t t-out="name"/>
</li>
<li>
<strong>订单交期:</strong>
<t t-out="order_deadline.format('L LTS')"/>
</li>
<li>
<strong>产品名称:</strong>
<t t-out="product_id[1]"/>
</li>
<li>
<strong>数量:</strong>
<t t-out="product_qty"/>
</li>
<li>
<strong>计划开始时间:</strong>
<t t-out="userTimezoneStartDate.format('L LTS')"/>
</li>
<li>
<strong>计划结束时间:</strong>
<t t-out="userTimezoneStopDate.format('L LTS')"/>
</li>
</ul>
</div>
</div>
</div>
</templates>
</gantt>
</field>
</record>
<record id="sf_machine_schedule_tree" model="ir.ui.view">
<field name="name">sf.machine.schedule.tree</field>
<field name="model">sf.machine.schedule</field>
<field name="arch" type="xml">
<tree string="机台作业计划">
<field name="name"/>
</tree>
</field>
</record>
<record id="sf_production_plan_action" model="ir.actions.act_window">
<field name="name">CNC产线计划排程</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.production.plan</field>
<field name="view_mode">gantt,tree,form</field>
</record>
<!-- 这个也是制造订单生产计划只是把tree视图放在了默认位置 -->
<record id="sf_production_plan_action1" model="ir.actions.act_window">
<field name="name">CNC产线计划排程</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.production.plan</field>
<field name="view_mode">tree,gantt,form</field>
<!-- <field name="context">{'search_default_group_by_state': 1, 'search_default_draft': 1, 'display_complete': True}</field> -->
<field name="context">{'search_default_draft': 1, 'display_complete': True}</field>
</record>
<menuitem
id="sf_production_plan_menu"
name="计划"
sequence="150"
action="sf_production_plan_action"
groups="sf_base.group_plan_dispatch"
web_icon="sf_plan,static/description/计划.png"
/>
<!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> -->
<!-- <field name="name">Custom Manufacturing Orders</field> -->
<!-- <field name="action" ref="mrp.mrp_manufacturing_action"/> -->
<!-- --><!-- 扩展现有的动作 --><!-- -->
<!-- </record> -->
<record model="ir.actions.act_window" id="mrp_custom_action">
<!-- 自定义额外的动作 -->
<field name="name">制造订单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('picking_type_id.active', '=', True)]</field>
</record>
<record model="ir.actions.act_window" id="sale_custom_action">
<!-- 自定义额外的动作 -->
<field name="name">报价单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form</field>
</record>
<record model="ir.actions.act_window" id="action_machine_work_schedule">
<!-- 自定义额外的动作 -->
<field name="name">机台作业计划</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.machine.schedule</field>
<field name="view_mode">tree</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
暂无机台作业计划
</p>
<p>
跟进请求的处理,并且和合作者沟通。
</p>
</field>
</record>
<menuitem
id="mrp_custom_menu"
name="制造订单"
sequence="150"
action="mrp_custom_action"
parent="sf_production_plan_menu"
/>
<menuitem
id="sf_workpiece_delivery_menu"
name="工件配送"
sequence="10"
action="sf_manufacturing.sf_workpiece_delivery_act"
parent="mrp.menu_mrp_manufacturing"
/>
<menuitem
id="sf_workpiece_delivery__empty_racks_menu"
name="空料架配送"
sequence="11"
action="sf_manufacturing.sf_workpiece_delivery_empty_racks_act"
groups="sf_base.group_sf_order_user,sf_base.group_sf_mrp_manager,sf_base.group_sf_equipment_user"
parent="mrp.menu_mrp_manufacturing"
/>
<!-- <menuitem -->
<!-- id="sale_custom_menu" -->
<!-- name="报价单" -->
<!-- sequence="50" -->
<!-- action="sale_custom_action" -->
<!-- parent="sf_production_plan_menu" -->
<!-- /> -->
<menuitem
id="schedule_custom_menu"
name="排程单"
sequence="180"
action="sf_production_plan_action1"
parent="sf_production_plan_menu"
/>
<menuitem
id="menu_plan_config_root"
name="配置"
sequence="190"
parent="sf_production_plan_menu"
/>
<!-- 二级菜单:工厂日历 -->
<menuitem
id="menu_factory_calendar"
name="工厂日历"
parent="menu_plan_config_root"
action="resource.action_resource_calendar_form"
sequence="10"
/>
<!-- <record id="action_resource_calendar_form" model="ir.actions.act_window">-->
<!-- <field name="name">Working Times</field>-->
<!-- <field name="res_model">resource.calendar</field>-->
<!-- <field name="view_mode">tree,form</field>-->
<!-- <field name="view_id" eval="False"/>-->
<!-- <field name="search_view_id" ref="view_resource_calendar_search"/>-->
<!-- <field name="help" type="html">-->
<!-- <p class="o_view_nocontent_smiling_face">-->
<!-- Define working hours and time table that could be scheduled to your project members-->
<!-- </p>-->
<!-- </field>-->
<!-- </record>-->
<!-- <record id="action_factory_calendar" model="ir.actions.act_window">-->
<!-- <field name="name">工厂日历</field>-->
<!-- <field name="res_model">resource.calendar</field>-->
<!-- <field name="view_mode">tree,form</field>-->
<!-- <field name="help" type="html">-->
<!-- <p class="o_view_nocontent_smiling_face">-->
<!-- 创建和管理工厂工作日历-->
<!-- </p>-->
<!-- </field>-->
<!-- </record>-->
</data>
</odoo>