Files
test/sf_manufacturing/views/mrp_production_addional_change.xml

750 lines
52 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="custom_mrp_production_tree_view" model="ir.ui.view">
<field name="name">custom.mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<!-- <xpath expr="//button[@name='do_unreserve']" position="after">-->
<!-- <button name="do_update_program" type="object" string="更新程序"-->
<!-- groups="sf_base.group_sf_mrp_user"/>-->
<!-- </xpath>-->
<xpath expr="//field[@name='product_id']" position="replace"/>
<xpath expr="//field[@name='product_qty']" position="replace"/>
<xpath expr="//field[@name='product_uom_id']" position="replace"/>
<xpath expr="//field[@name='reservation_state']" position="replace"/>
<xpath expr="//field[@name='date_deadline']" position="replace"/>
<xpath expr="//field[@name='name']" position="after">
<field name="product_id" readonly="1" optional="show"/>
<field name="part_name" readonly="1" optional="hide"/>
<field name="part_number" readonly="1" optional="show"/>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/>
<field name="deadline_of_delivery" optional="show"/>
</xpath>
<xpath expr="//field[@name='product_qty']" position="after">
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}"
groups="uom.group_uom" optional="show"/>
</xpath>
<xpath expr="//field[@name='date_planned_start']" position="replace">
<field name="date_planned_start" optional="show"/>
<field name="date_planned_finished" string="计划结束时间"/>
<!-- <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="show"/> -->
</xpath>
<xpath expr="//field[@name='production_real_duration']" position="after">
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'"
decoration-success="reservation_state == 'assigned'"/>
</xpath>
<xpath expr="//field[@name='state']" position="before">
<field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'"
decoration-success="production_type == '自动化产线加工'" optional="show"/>
</xpath>
<xpath expr="//field[@name='activity_ids']" position="replace">
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
</xpath>
<xpath expr="//field[@name='origin']" position="replace">
<field name="sale_order_id" optional="show"/>
<field name="origin" optional="hide"/>
</xpath>
<xpath expr="//field[@name='components_availability']" position="replace">
<field name="components_availability" options='{"lazy": true}'
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
optional="hide"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
</xpath>
<!-- <xpath expr="//field[@name='state']" position="after"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
<xpath expr="//field[@name='production_real_duration']" position="before">
<field name="delivery_status" optional="show" widget="badge"
decoration-success="delivery_status == '正常'"
decoration-warning="delivery_status == '预警'"
decoration-danger="delivery_status == '已逾期'"/>
</xpath>
<xpath expr="//field[@name='production_real_duration']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<!-- 增加权限相关的按钮 -->
<!-- 制造订单的操作按钮只让制造用户可见 -->
<record id="custom_mrp_production_form_view" model="ir.ui.view">
<field name="name">custom.mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="attributes">
<!-- <attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done -->
<!-- </attribute> -->
<attribute name="statusbar_visible">
technology_to_confirmed,confirmed,pending_cam,progress,rework,scrap,done
</attribute>
</xpath>
<xpath expr="//div[@class='d-flex flex-row align-items-start']//span[1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_product_forecast_report']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//sheet//group//group[2]//label" position="before">
<!-- <field name="process_state"/> -->
<field name="state" readonly="1"/>
<!-- <field name="process_state"/> -->
</xpath>
<xpath expr="//sheet//group//group//div[3]" position="after">
<field name="production_type" readonly="1"/>
<field name="manual_quotation" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
<field name="programming_no" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
<field name="programming_state" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"
decoration-success="programming_state == '已编程'"
decoration-warning="programming_state =='编程中'"
decoration-danger="programming_state =='已编程未下发'"/>
<field name="work_state" invisible="1"/>
<field name="schedule_state" invisible='1'/>
<field name="is_scrap" invisible='1'/>
<field name="is_rework" invisible='1'/>
</xpath>
<xpath expr="//field[@name='user_id']" position="before">
<field name="plan_start_processing_time" readonly="1"/>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="production_line_id" readonly="1"/>
<!-- <field name="production_line_state" readonly="1"/>-->
<field name="part_name"/>
<field name="part_number" string="零件图号"/>
<field name="tool_state"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
<field name="tool_state_remark" string="备注" attrs="{'invisible': [('tool_state', '!=', '1')]}"/>
<field name="sale_order_id" readonly="1"/>
<field name="deadline_of_delivery" readonly="1"/>
<field name="tool_state_remark2" invisible="1"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[1]" position="replace">
<button name="button_mark_done"
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}"
string="验证" type="object" class="oe_highlight"
confirm="There are no components to consume. Are you still sure you want to continue?"
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[2]" position="replace">
<button name="button_mark_done"
attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}"
string="验证" type="object" data-hotkey="g"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_scrap'])" position="replace">
<button name="technology_confirm" string="工艺确认" type="object" class="oe_highlight"
attrs="{'invisible': [('state', '!=', 'technology_to_confirmed')]}"></button>
<button name="technology_back_adjust" string="退回调整" type="object" class="oe_highlight"
attrs="{'invisible': [('state', '!=', 'confirmed')]}"></button>
<button name="button_scrap" invisible="1"/>
<button name="do_update_program" string="更新程序" type="object" groups="sf_base.group_sf_mrp_user"
confirm="是否确认更新程序"
attrs="{'invisible': ['|',('state', '!=', 'rework'),('programming_state', '!=', '已编程未下发')]}"/>
<button name="button_rework" string="返工" type="object" groups="sf_base.group_sf_mrp_user"
attrs="{'invisible': ['|','|',('state', '!=', 'rework') ,('programming_state', '!=', '已编程'),('is_rework', '=', True)]}"/>
<button name="button_scrap_new" string="报废" type="object"
groups="sf_base.group_sf_mrp_user"
attrs="{'invisible': ['|',('is_scrap', '=', False),('state','=','cancel')]}"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [
'|',
('move_raw_ids', '=', []),
'&amp;',
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight"
data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace">
<button name="button_mark_done" attrs="{'invisible': [
'|',
('move_raw_ids', '!=', []),
'&amp;',
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="标记完成" type="object" class="oe_highlight"
data-hotkey="g"
confirm="There are no components to consume. Are you still sure you want to continue?"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_unplan']" position="replace">
<button name="button_unplan" type="object" string="取消安排"
attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}"
data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<!-- <xpath expr="//header//button[@name='button_scrap']" position="replace">-->
<!-- <button name="button_scrap" type="object" string="报废"-->
<!-- attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y"-->
<!-- groups="sf_base.group_sf_mrp_user"/>-->
<!-- </xpath>-->
<xpath expr="//header//button[@name='action_confirm']" position="replace">
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="确认"
type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_plan']" position="replace">
<button name="button_plan"
attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}"
type="object" string="Plan" class="oe_highlight" data-hotkey="x"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_assign']" position="replace">
<button name="action_assign"
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}"
string="Check availability" type="object" data-hotkey="q"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="Unreserve"
attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}"
string="Unlock" groups="sf_base.group_sf_mrp_user" type="object"
help="Unlock the manufacturing order to adjust what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//button[@name='action_view_mo_delivery']" position="before">
<button class="oe_stat_button" name="action_view_remanufacture_productions" type="object"
icon="fa-wrench" attrs="{'invisible': [('remanufacture_count', '=', 0)]}"
groups="mrp.group_mrp_user">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="remanufacture_count"/>
</span>
<span class="o_stat_text">新的制造</span>
</div>
</button>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}"
string="Lock" groups="sf_base.group_sf_mrp_user" type="object"
help="Lock the manufacturing order to prevent changes to what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
<button name="action_serial_mass_produce_wizard"
attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce"
type="object" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
<button name="button_unbuild" type="object" string="拆单"
attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='button_plan']" position="replace">
<!-- <button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/> -->
</xpath>
<xpath expr="//header//button[@name='action_assign']" position="replace">
<button name="action_assign"
attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}"
string="检查可用量" type="object" data-hotkey="q" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="取消保留"
attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}"
string="取消阻塞" groups="sf_base.group_sf_mrp_user" type="object"
help="Unlock the manufacturing order to adjust what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
<button name="action_toggle_is_locked"
attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}"
string="阻塞" groups="sf_base.group_sf_mrp_user" type="object"
help="Lock the manufacturing order to prevent changes to what has been consumed or produced."
data-hotkey="l"/>
</xpath>
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
<button name="action_serial_mass_produce_wizard"
attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="批量生产"
type="object" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel'][2]" position="replace">
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'rework', 'cancel')), ('confirm_cancel', '=', False)]}"
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel'][1]" position="replace"></xpath>
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
<button name="button_unbuild" type="object" string="拆单"
attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//sheet//notebook//page[@name='operations']" position="attributes">
<attribute name="attrs">{'invisible': [('workorder_ids', '=', [])]}
</attribute>
</xpath>
<xpath expr="//sheet//notebook//page[@name='operations']//field[@name='workorder_ids']"
position="replace">
<field name="workorder_ids"
attrs="{'readonly': ['|', ('state', '!=', 'test_value'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}"
context="{'tree_view_ref': 'mrp.mrp_production_workorder_tree_editable_view', 'default_product_uom_id': product_uom_id, 'from_manufacturing_order': True}"/>
</xpath>
<xpath expr="//sheet//notebook//page[@name='operations']" position="after">
<page string="检测结果" attrs="{'invisible': [('detection_result_ids', '=', [])]}">
<field name="detection_result_ids" string="" readonly="0">
<tree sample="1">
<field name="production_id" invisible="1"/>
<field name="processing_panel"/>
<field name="routing_type"/>
<field name="rework_reason"/>
<field name="detailed_reason"/>
<field name="test_results"/>
<field name="handle_result"/>
<field name="test_report" invisible="1"/>
<button name="button_look_test_report" string="查看测试报告" type="object"
attrs="{'invisible': [('test_report', '=', False)]}"
class="btn btn-primary me-1"/>
</tree>
</field>
</page>
</xpath>
<xpath expr="//sheet//notebook//page[@name='components']" position="attributes">
<attribute name="string">投料</attribute>
</xpath>
<xpath expr="//field[@name='components_availability']" position="attributes">
<attribute name="string">投料状态</attribute>
</xpath>
<xpath expr="//sheet//notebook" position="inside">
<page string="零件图纸">
<field name="part_drawing" widget="adaptive_viewer"/>
</page>
</xpath>
<xpath expr="//sheet//notebook//page[@name='components']" position="before">
<page string="工艺设计" attrs="{'invisible': [('state', '!=', 'technology_to_confirmed')]}">
<field name="technology_design_ids" widget="one2many">
<tree editable="bottom">
<field name="sequence" widget="handle"/>
<field name="route_id" context="{'production_id': production_id}"
attrs="{'readonly': [('id', '!=', False)]}" options="{'no_create': True}"/>
<field name="process_parameters_id"
attrs="{'readonly': [('id', '!=', False),('routing_tag', '=', 'standard')]}"
string="参数" context="{'route_id':route_id,'production_id': production_id}"
options="{'no_create': True}"/>
<field name="panel" readonly="1"/>
<field name="routing_tag" readonly="1" widget="badge"
decoration-success="routing_tag == 'standard'"
decoration-warning="routing_tag == 'special'"/>
<field name="time_cycle_manual" attrs="{'readonly': [('id', '!=', False)]}"/>
<field name="is_auto" invisible="1"/>
<field name="production_id" invisible="1"/>
<button name="unlink_technology_design" confirm="是否确认删除?" class="oe_highlight"
attrs="{'invisible': [('is_auto', '=', True)]}" type="object"
string="删除"></button>
</tree>
</field>
</page>
</xpath>
<xpath expr="//sheet//notebook" position="inside">
<page string="质检标准">
<field name="quality_standard" widget="adaptive_viewer"/>
</page>
</xpath>
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/span[last()]"
position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/button[@name='action_product_forecast_report']"
position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//sheet/div[@class='oe_button_box']/button[@name='action_view_mrp_production_childs']/div/span[last()]"
position="replace">
<span class="o_stat_text">子MO</span>
</xpath>
</field>
</record>
<record id="product_template_search_view_manual_quotation" model="ir.ui.view">
<field name="name">product.template.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="人工编程" name="manual_quotation" domain="[('manual_quotation', '=', True)]"/>
</xpath>
</field>
</record>
<!-- 工单的操作按钮只让制造用户可见 -->
<record id="sf_mrp_production_workorder_tree_editable_view" model="ir.ui.view">
<field name="name">sf.mrp.production.workorder.tree.editable</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="default_order">sequence</attribute>
<attribute name="decoration-warning">delivery_warning == 'warning'</attribute>
<attribute name="decoration-danger">delivery_warning == 'overdue'</attribute>
</xpath>
<xpath expr="//field[@name='state']" position="replace">
<field name="delivery_warning" invisible="True"/>
<field name="state" widget="badge" decoration-warning="state == 'progress'"
decoration-success="state == 'done'" decoration-danger="state in ('cancel','rework')"
decoration-muted="state == 'to be detected'"
decoration-info="state not in ('progress', 'done', 'cancel','rework','to be detected')"
attrs="{'invisible': [('production_state', '=', 'draft')], 'column_invisible': [('parent.state', '=', 'draft')]}"/>
</xpath>
<xpath expr="//tree//button[@name='button_start']" position="replace">
<field name="routing_type" invisible="True"/>
<button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始?"
attrs="{'invisible': [('state', '!=', 'ready')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_pending']" position="replace">
<button name="button_pending" type="object" string="Pause" class="btn-warning"
attrs="{'invisible': ['|', '|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_finish']" position="replace">
<button name="button_finish" type="object" string="Done" class="btn-success"
attrs="{'invisible': ['|', '|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"
groups="sf_base.group_sf_mrp_user"
confirm="是否确认完成?"/>
</xpath>
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
<button name="button_unblock" type="object" string="Unblock"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
title="Open Work Order"
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
<!-- ======= -->
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}" -->
<!-- groups="sf_base.group_sf_mrp_user"/> -->
</xpath>
<xpath expr="//tree//button[@name='button_pending']" position="replace">
<button name="button_pending" type="object" string="暂停" class="btn-warning"
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_finish']" position="replace">
<button name="button_finish" type="object" string="完成" class="btn-success"
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user" confirm="是否确认完成?"/>
</xpath>
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="阻塞"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
<button name="button_unblock" type="object" string="取消阻塞"
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
title="未完成工单"
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
</xpath>
</field>
</record>
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
<record id="sf_mrp_production_tree_view" model="ir.ui.view">
<field name="name">sf.mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='button_plan']" position="replace">
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
</xpath>
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
</xpath>
<xpath expr="//field[@name='state']" position="replace">
<field name="state" decoration-success="state in ('done', 'to_close')"
decoration-warning="state == 'progress'" decoration-info="state == 'confirmed'"
decoration-danger="state in ('cancel','rework','scrap')" decoration-muted="state == 'draft'"
optional="show" widget="badge" class="text-dark"/>
</xpath>
<xpath expr="//field[@name='state']" position="after">
<field name="tool_state" invisible="1"/>
</xpath>
</field>
</record>
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
<!-- <field name="name">custom.mrp.production.form</field> -->
<!-- <field name="model">mrp.production</field> -->
<!-- <field name="inherit_id" ref="mrp.mrp_production_form_view"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//header//field[@name='state']" position="replace"> -->
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,已排程,progress,done"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//header" position="inside"> -->
<!-- <button name="action_view_production_schedule" string="生产排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','已排程','progress','done','to_close'])]}"/> -->
<!-- <button name="cancel_plan" string="取消排程" type="object" attrs="{'invisible': [('state', 'in', ['draft', 'cancel','progress','done','to_close','confirmed'])]}"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='product_id']" position="after"> -->
<!-- <field name="production_line_id"/> -->
<!-- <field name="date_planned_finished" string="计划结束时间"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//sheet//group//group//field[@name='date_planned_start']" position="after"> -->
<!-- <field name="date_planned_finished"/> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<record id="custom_view_mrp_production_filter" model="ir.ui.view">
<field name="name">custom.mrp.production.select</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.view_mrp_production_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='filter_in_progress']" position="before">
<filter string="返工" name="filter_rework" domain="[('state', '=', 'rework')]"/>
<filter string="报废" name="filter_scrap" domain="[('state', '=', 'scrap')]"/>
</xpath>
<xpath expr="//filter[@name='planning_issues']" position="before">
<separator/>
<filter string="返工且已编程" name="filter_rework_programmed"
domain="[('state', '=', 'rework'),('programming_state', '=', '已编程')]"/>
<filter string="返工且已编程未下发" name="filter_rework_programmed_not_delivered"
domain="[('state', '=', 'rework'),('programming_state', '=', '已编程未下发')]"/>
<separator/>
<filter name="filter_programming" string="编程中"
domain="[('programming_state', '=', '编程中')]"/>
<filter name="filter_programmed" string="已编程"
domain="[('programming_state', '=', '已编程')]"/>
<filter name="filter_programmed_not_delivered" string="已编程未下发"
domain="[('programming_state', '=', '已编程未下发')]"/>
<separator/>
</xpath>
<xpath expr="//search" position="inside">
<searchpanel>
<field name="state" icon="fa-filter" enable_counters="1"/>
<field name="delivery_status" icon="fa-filter" enable_counters="1"/>
<field name="production_type" icon="fa-filter" enable_counters="1"/>
</searchpanel>
</xpath>
<filter name='todo' position="replace"/>
</field>
</record>
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已完成" name="filter_done" domain="[('state', '=', 'done')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已取消" name="filter_cancel" domain="[('state', '=', 'cancel')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="进行中" name="filter_progress" domain="[('state', '=', 'progress')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="已确认" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//filter[@name='filter_draft']" position="after"> -->
<!-- <filter string="草稿" name="filter_draft" domain="[('state', '=', 'draft')]"/> -->
<!-- </xpath> -->
<!-- 产品模板修改>>>增加“规格”字段specification_id -->
<record id="custom_product_template_kanban_view" model="ir.ui.view">
<field name="name">custom.Product.template.product.kanban</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_kanban_view"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="replace">
<kanban sample="1" class="o_kanban_product_template">
<field name="id"/>
<field name="product_variant_count"/>
<field name="currency_id"/>
<field name="activity_state"/>
<progressbar field="activity_state"
colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_image me-1">
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)"
alt="Product" class="o_image_64_contain"/>
</div>
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
<field name="priority" widget="priority"/>
</div>
<t t-if="record.brand_id.raw_value">
<div class="mt-1">
品牌:
<field name="brand_id"></field>
</div>
</t>
<div name="product_specification_id" class="mt-1">
规格:
<field name="specification_id"/>
<field name="specification_fixture_id"/>
</div>
<t t-if="record.default_code.value">[<field name="default_code"/>]
</t>
<div t-if="record.product_variant_count.value &gt; 1"
groups="product.group_product_variant">
<strong>
<t t-esc="record.product_variant_count.value"/>
Variants
</strong>
</div>
<div name="product_lst_price" class="mt-1">
价格:
<field name="list_price" widget="monetary"
options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sf_test_report_form">
<field name="name">sf.detection.result</field>
<field name="model">sf.detection.result</field>
<field name="arch" type="xml">
<form>
<group>
<field name="handle_result"/>
<field name="test_report" readonly="1" widget="pdf_viewer"/>
</group>
</form>
</field>
</record>
<record id="action_test_report_form" model="ir.actions.act_window">
<field name="name">检测报告</field>
<field name="res_model">sf.detection.result</field>
<field name="view_mode">form</field>
</record>
<!-- <menuitem action="mrp.mrp_production_action"-->
<!-- id="mrp_production_action"-->
<!-- sequence="1" active="False"/>-->
<!-- &lt;!&ndash; <record id="mrp_production_action_sf" model="ir.actions.act_window">&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="name">Manufacturing Orders</field>&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="type">ir.actions.act_window</field>&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="res_model">mrp.production</field>&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="search_view_id" ref="mrp.view_mrp_production_filter"/>&ndash;&gt;-->
<!-- &lt;!&ndash; &lt;!&ndash; <field name="context">{'search_default_todo': True, 'default_company_id': allowed_company_ids[0]}</field>&ndash;&gt;&ndash;&gt;-->
<!-- &lt;!&ndash; <field name="domain">[('picking_type_id.active', '=', True)]</field>&ndash;&gt;-->
<!-- &lt;!&ndash; </record>&ndash;&gt;-->
<!-- &lt;!&ndash; <menuitem action="mrp_production_action_sf"&ndash;&gt;-->
<!-- &lt;!&ndash; id="menu_mrp_production_action_sf"&ndash;&gt;-->
<!-- &lt;!&ndash; parent="mrp.menu_mrp_manufacturing"&ndash;&gt;-->
<!-- &lt;!&ndash; sequence="2"&ndash;&gt;-->
<!-- &lt;!&ndash; string="制造订单"/>&ndash;&gt;-->
<!-- <record id="mrp_production_action_sf" model="ir.actions.act_window">-->
<!-- <field name="name">Manufacturing Orders</field>-->
<!-- <field name="type">ir.actions.act_window</field>-->
<!-- <field name="res_model">mrp.production</field>-->
<!-- <field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>-->
<!-- <field name="view_id" eval="False"/>-->
<!-- <field name="search_view_id" ref="mrp.view_mrp_production_filter"/>-->
<!-- <field name="context">{'search_default_todo': True, 'default_company_id':-->
<!-- allowed_company_ids[0],'search_default_filter_rework':1,'search_default_filter_programmed':1}-->
<!-- </field>-->
<!-- <field name="domain">[('picking_type_id.active', '=', True)]</field>-->
<!-- &lt;!&ndash; &lt;!&ndash; <field name="help" type="html">&ndash;&gt;,'search_default_filter_rework': 1,&ndash;&gt;-->
<!-- &lt;!&ndash; 'search_default_filter_programming': 1&ndash;&gt;-->
<!-- &lt;!&ndash; <p class="o_view_nocontent_smiling_face">&ndash;&gt;-->
<!-- &lt;!&ndash; No manufacturing order found. Let's create one.&ndash;&gt;-->
<!-- &lt;!&ndash; </p>&ndash;&gt;-->
<!-- &lt;!&ndash; <p>&ndash;&gt;-->
<!-- &lt;!&ndash; Consume <a name="%(product.product_template_action)d" type='action' tabindex="-1">components</a> and&ndash;&gt;-->
<!-- &lt;!&ndash; build finished products using&ndash;&gt;-->
<!-- &lt;!&ndash; <a name="%(mrp_bom_form_action)d" type='action' tabindex="-1">bills of materials</a>&ndash;&gt;-->
<!-- &lt;!&ndash; </p>&ndash;&gt;-->
<!-- &lt;!&ndash; </field>&ndash;&gt;-->
<!-- </record>-->
<!-- <menuitem action="sf_manufacturing.mrp_production_action_sf"-->
<!-- id="mrp_production_action"-->
<!-- parent="mrp.menu_mrp_manufacturing"-->
<!-- sequence="1"/>-->
<menuitem id="mrp.menu_mrp_production_action"
name="制造订单"
parent="mrp.menu_mrp_manufacturing"
action="mrp.mrp_production_action"
groups="sf_base.group_plan_dispatch,sf_base.group_sf_mrp_manager"
sequence="1"/>
<menuitem id="stock_picking_type_menu"
name="驾驶舱"
parent="stock.menu_stock_root"
action="stock.stock_picking_type_action"
groups="sf_base.group_sf_stock_user"
sequence="0"/>
</data>
</odoo>