优化权限相关

This commit is contained in:
mgw
2023-12-17 10:48:51 +08:00
parent 0a3bd37224
commit 6738a855bb
15 changed files with 561 additions and 4 deletions

View File

@@ -52,6 +52,24 @@
</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="//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>
</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> -->