基础排程基本完成

This commit is contained in:
mgw
2023-08-30 17:50:43 +08:00
parent e3f58ccee8
commit 41566a4d74
7 changed files with 276 additions and 92 deletions

View File

@@ -7,14 +7,14 @@
<field name="arch" type="xml">
<tree string="订单计划">
<!-- sequence、pl_no、pl_name、quantity、plan_start_time、plan_end_time、actual_start_time、actual_end_time、state、create_uid、create_date -->
<field name="sequence"/>
<!-- <field name="sequence"/> -->
<field name="name"/>
<field name="quantity"/>
<field name="plan_start_time"/>
<field name="plan_end_time"/>
<field name="state"/>
<button name="do_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="cancel_production_schedule" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['produce'])]}"/>
<field name="product_qty"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="state" widget="badge" decoration-warning="state == 'draft'" decoration-success="state == 'done'"/>
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}"/>
</tree>
</field>
</record>
@@ -25,8 +25,10 @@
<field name="arch" type="xml">
<form string="订单计划">
<header>
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,produce"/>
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/>
<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,produce"/> -->
</header>
<sheet>
<div class="oe_title">
@@ -36,10 +38,12 @@
</div>
<group>
<group string="基本信息">
<field name="name"/>
<field name="quantity"/>
<field name="plan_start_time"/>
<field name="plan_end_time"/>
<field name="production_id"/>
<field name="product_id"/>
<field name="origin"/>
<field name="product_qty"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="state"/>
<field name="production_line_id"/>
</group>
@@ -87,9 +91,9 @@
<field name="arch" type="xml">
<search string="订单计划">
<field name="name"/>
<field name="quantity"/>
<field name="plan_start_time"/>
<field name="plan_end_time"/>
<field name="product_qty"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="state"/>
<searchpanel class="account_root">
<field name="state" icon="fa-filter"/>
@@ -102,7 +106,7 @@
<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="plan_end_time" date_start="plan_start_time"
<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"
@@ -112,9 +116,9 @@
form_view_id="sf_production_plan_form">
<field name="name"/>
<field name="quantity"/>
<field name="plan_start_time"/>
<field name="plan_end_time"/>
<field name="product_qty"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="state"/>
<templates>
<div t-name="gantt-popover" class="container-fluid">
@@ -135,7 +139,7 @@
</li>
<li>
<strong>数量:</strong>
<t t-out="quantity"/>
<t t-out="product_qty"/>
</li>
<li>
<strong>状态:</strong>
@@ -215,12 +219,71 @@
<field name="view_mode">gantt,tree,form</field>
</record>
<!-- 这个也是制造订单生产计划只是把tree视图放在了默认位置 -->
<record id="sf_production_plan_action1" model="ir.actions.act_window">
<field name="name">制造订单生产计划</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>
</record>
<menuitem
id="sf_production_plan_menu"
name="制造订单生产计划"
parent="mrp_workorder.mrp_workorder_menu_planning"
sequence="10"
name="计划"
sequence="150"
action="sf_production_plan_action"
/>
<!-- <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>
</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>
<menuitem
id="mrp_custom_menu"
name="制造订单"
sequence="150"
action="mrp_custom_action"
parent="sf_production_plan_menu"
/>
<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="mrp_custom_menuitem" -->
<!-- name="My Custom Menuitem" -->
<!-- sequence="20" -->
<!-- action="mrp_custom_action"/> -->
<!-- --><!-- 自定义额外的菜单项 --><!-- -->
<!-- </field> -->
</data>
</odoo>