|
|
|
|
@@ -53,6 +53,7 @@
|
|
|
|
|
</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>
|
|
|
|
|
@@ -61,23 +62,151 @@
|
|
|
|
|
<xpath expr="//field[@name='state']" position="attributes">
|
|
|
|
|
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
|
|
|
|
|
</xpath>
|
|
|
|
|
<xpath expr="//form//header//button[@name='action_confirm']" position="after">
|
|
|
|
|
<field name="active" invisible="1"/>
|
|
|
|
|
<field name="check_status" invisible="1"/>
|
|
|
|
|
<!-- <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 name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
|
|
|
|
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
|
|
|
|
</xpath>
|
|
|
|
|
<xpath expr="//field[@name='user_id']" position="after">
|
|
|
|
|
<field name="programming_no"/>
|
|
|
|
|
<field name="work_state" invisible="1"/>
|
|
|
|
|
<field name="programming_state"/>
|
|
|
|
|
</xpath>
|
|
|
|
|
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
|
|
|
|
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
|
|
|
|
|
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" groups="sf_base.group_sf_mrp_user"/>
|
|
|
|
|
</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="Validate" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
|
|
|
|
</xpath>
|
|
|
|
|
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
|
|
|
|
|
<button name="button_mark_done" attrs="{'invisible': [
|
|
|
|
|
'|',
|
|
|
|
|
('move_raw_ids', '=', []),
|
|
|
|
|
'&',
|
|
|
|
|
'|',
|
|
|
|
|
('state', 'not in', ('confirmed', 'progress')),
|
|
|
|
|
('qty_producing', '!=', 0),
|
|
|
|
|
('state', '!=', 'to_close')]}" string="Mark as Done" 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', '!=', []),
|
|
|
|
|
'&',
|
|
|
|
|
'|',
|
|
|
|
|
('state', 'not in', ('confirmed', 'progress')),
|
|
|
|
|
('qty_producing', '!=', 0),
|
|
|
|
|
('state', '!=', 'to_close')]}" string="Mark as Done" 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="Confirm" 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="//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='action_cancel']" position="replace">
|
|
|
|
|
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
|
|
|
|
|
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', '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='button_unbuild']" position="replace">
|
|
|
|
|
<button name="button_unbuild" type="object" string="Unbuild" attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v" groups="sf_base.group_sf_mrp_user"/>
|
|
|
|
|
</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//button[@name='button_start']" position="replace">
|
|
|
|
|
<button name="button_start" type="object" string="Start" 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="Pause" class="btn-warning"
|
|
|
|
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" 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"/>
|
|
|
|
|
</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')]}" 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')]}" 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"/>
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
</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> -->
|
|
|
|
|
|