如何解决添加到现有菜单的菜单不显示的问题
how to fix the problem that a menu which is added to an existing menu doesn't be shown
我已经开发了一个自定义模块,它在出勤模块中添加了一个新菜单来为两个组创建出勤修改请求 "attendance/manual attendance" 和 "attendance/manager" 问题是我的菜单只为管理员添加用户。如果我连接的用户具有访问权限经理或考勤模块的手动考勤,它将不会显示。任何帮助的想法?
这是我的代码
hr_attendance_modification_request_view.xml
<record model="ir.ui.view" id="view_attendance_modification_request_form">
<field name="name">attendance.modification.request.form</field>
<field name="model">attendance.modification.request</field>
<field name="arch" type="xml">
<form string="Attendance modification Request">
<header>
<field name="state" statusbar_visible="draft,waiting,approved,cancel" widget="statusbar" />
<button name="submit_modification" string="Submit for manager" type="object" class="btn-primary"
attrs="{'invisible': [('state','not in','draft')]}"/>
<button name="modification_approval" type="object" string="Approve" class="oe_highlight"
groups="hr_attendance.group_hr_attendance_manager"
attrs="{'invisible': [('state','not in','waiting')]}"/>
<button name="modification_rejection" type="object" string="Cancel" class="oe_highlight"
groups="hr_attendance.group_hr_attendance_manager"
attrs="{'invisible': [('state','not in','waiting')]}"/>
</header>
<sheet>
<h2>
<group>
<field name="employee"/>
</group>
</h2>
<group string="Morning" col="4" colspan="4">
<field name="time_check_in_1"/>
<field name="time_check_out_1"/>
</group>
<group string="Afternoon" col="4" colspan="4">
<field name="time_check_in_2"/>
<field name="time_check_out_2"/>
</group>
<label for="note"/>
<field name="note"/>
</sheet>
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="attendance_modification_request_form_action">
<field name="name">Attendance modification Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">attendance.modification.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{"search_default_requested_by":uid}</field>
<!-- <field name="search_view_id" ref="view_attendance_request_search"/>-->
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new attendance modification request process.
</p>
</field>
</record>
<menuitem action="attendance_modification_request_form_action" id="menu_attendance_modification_request"
name="Attendance modification request" parent="hr_attendance.menu_hr_attendance_manage_attendances"
sequence="14" groups="hr_attendance.group_hr_attendance"/>
<record model="ir.actions.act_window" id="action_view_attendance_request_approval">
<field name="name">Attendance modification request to approve</field>
<field name="res_model">attendance.modification.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','!=','approved'),('state','!=','cancel')]</field>
<field name="help" type="html">
<p class="oe_view_no_content_create">Create new Record
</p>
</field>
</record>
<menuitem action="action_view_attendance_request_approval" id="menu_attendance_modification_request_to_approve"
name="Attendance modification request to Approve"
parent="hr_attendance.menu_hr_attendance_manage_attendances"
sequence="15" groups="hr_attendance.group_hr_attendance_manager"/>
我应该添加 ir.model.access.csv 文件
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_attendance_modification_request,access_attendance_modification_request,model_attendance_modification_request,hr_attendance.group_hr_attendance_manager,1,1,1,1 access_attendance_modification_request,access_attendance_modification_request,model_attendance_modification_request,hr_attendance.group_hr_attendance,1,1,1,1
我已经开发了一个自定义模块,它在出勤模块中添加了一个新菜单来为两个组创建出勤修改请求 "attendance/manual attendance" 和 "attendance/manager" 问题是我的菜单只为管理员添加用户。如果我连接的用户具有访问权限经理或考勤模块的手动考勤,它将不会显示。任何帮助的想法? 这是我的代码 hr_attendance_modification_request_view.xml
<record model="ir.ui.view" id="view_attendance_modification_request_form">
<field name="name">attendance.modification.request.form</field>
<field name="model">attendance.modification.request</field>
<field name="arch" type="xml">
<form string="Attendance modification Request">
<header>
<field name="state" statusbar_visible="draft,waiting,approved,cancel" widget="statusbar" />
<button name="submit_modification" string="Submit for manager" type="object" class="btn-primary"
attrs="{'invisible': [('state','not in','draft')]}"/>
<button name="modification_approval" type="object" string="Approve" class="oe_highlight"
groups="hr_attendance.group_hr_attendance_manager"
attrs="{'invisible': [('state','not in','waiting')]}"/>
<button name="modification_rejection" type="object" string="Cancel" class="oe_highlight"
groups="hr_attendance.group_hr_attendance_manager"
attrs="{'invisible': [('state','not in','waiting')]}"/>
</header>
<sheet>
<h2>
<group>
<field name="employee"/>
</group>
</h2>
<group string="Morning" col="4" colspan="4">
<field name="time_check_in_1"/>
<field name="time_check_out_1"/>
</group>
<group string="Afternoon" col="4" colspan="4">
<field name="time_check_in_2"/>
<field name="time_check_out_2"/>
</group>
<label for="note"/>
<field name="note"/>
</sheet>
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="attendance_modification_request_form_action">
<field name="name">Attendance modification Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">attendance.modification.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{"search_default_requested_by":uid}</field>
<!-- <field name="search_view_id" ref="view_attendance_request_search"/>-->
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new attendance modification request process.
</p>
</field>
</record>
<menuitem action="attendance_modification_request_form_action" id="menu_attendance_modification_request"
name="Attendance modification request" parent="hr_attendance.menu_hr_attendance_manage_attendances"
sequence="14" groups="hr_attendance.group_hr_attendance"/>
<record model="ir.actions.act_window" id="action_view_attendance_request_approval">
<field name="name">Attendance modification request to approve</field>
<field name="res_model">attendance.modification.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','!=','approved'),('state','!=','cancel')]</field>
<field name="help" type="html">
<p class="oe_view_no_content_create">Create new Record
</p>
</field>
</record>
<menuitem action="action_view_attendance_request_approval" id="menu_attendance_modification_request_to_approve"
name="Attendance modification request to Approve"
parent="hr_attendance.menu_hr_attendance_manage_attendances"
sequence="15" groups="hr_attendance.group_hr_attendance_manager"/>
我应该添加 ir.model.access.csv 文件
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_attendance_modification_request,access_attendance_modification_request,model_attendance_modification_request,hr_attendance.group_hr_attendance_manager,1,1,1,1 access_attendance_modification_request,access_attendance_modification_request,model_attendance_modification_request,hr_attendance.group_hr_attendance,1,1,1,1