Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Trying to hide attendance create button for a user group

By
Satinder
on 8/23/13, 10:15 PM 4,072 views

Hi I'm trying to hide create button for attendance from 'Human Resources > Attendance'. Employees must be able to Sign In, Sign Out from top button, but should not be able to create the attendance from the HR > Attendance menu.

If I change access rights from 'Settings > Security > Access Control List > hr.attendance.system.user' and deselect 'create access' it disables both create button from attendance and Sign-In/Sign-Out button.

I just want to hide 'Create' button, so followed some questions answers from OpenERP Q&A help.

Tried changing the code from source files 'openerp > addons > hr_attendance > hr_attendance_view.xml'

<form string="Employee attendances" version="7.0">
                    <sheet>
                    <group>

To

<form string="Employee attendances" create="false" version="7.0">
                    <sheet>
                    <group>

but that did no affect at all in OpenERP.

Please help. I'm new to openerp and exploring it. Have PHP/HTML/CSS experience.

I just wish I could give the 'Create' button a CSS value like 'display: none' somewhere just to hide/invisible it.

Thanks & Regards, Sat

you can get some hint from here: https://www.odoo.com/forum/how-to/developers-13/setting-up-rules-access-right-in-xml-csv-files-12667

Jusab Sida (jsi)
on 6/26/15, 5:31 AM
1
Satinder
On 8/25/13, 12:34 PM

However, I got my answer out of already answered questions here on this help centre. help.openerp.com/question/11895/how-to-remove-create-button-in-a-model/

It's solved this way:

  • Go to Settings > Technical > User Interface > Views
  • There search 'attend' and press enter.
  • Edit 'hr.attendance.tree'
  • Change the code as bellows:

    <tree string="Employee attendances" create="false">

to

<tree string="Employee attendances" create="false">

and in 'hr.attendance.form' change

<form string="Employee attendances" version="7.0">

to

<form string="Employee attendances" create="false" version="7.0">

Go to 'Human Resources > Attendance' and you'll not find 'Create' button there for anyone. Even Manager/Officer won't be able to create attendance.

Next thing I'm finding is to disable it for a group/Employees only. Let's see.

If you have any suggestion, please suggest.

Thanks & Regards, Sat.

0
Gaurav Sahu
On 6/26/15, 12:52 AM



1. Make A Group (Setting --> Users --> Groups)
2. And then go to Access Rights Tab
3. Add item in one2many for hr.attendance object with only Read Access and Save group Form.
4. Add users in this group
5. Create button will not show for particular users



 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/23/13, 10:15 PM
Seen: 4072 times
Last updated: 6/26/15, 5:31 AM