Odoo Help


How can we block the editing of planned hours in a task

Jean-Philippe Bourque
on 3/21/13, 12:43 PM 2,072 views

Hi, I'm looking if it's possible to block to "Project User" the edition of the field "Planned hours" in a task.


Naresh Soni (nch)

--Naresh Soni (nch)--
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

Naresh Soni (nch)
On 3/21/13, 12:55 PM

Hello Jean,

Yes, Its possible. You can create a new group or assign an existing group where only project managers are allowed and assign that group to the planned hours field.By doing this the user that doesn't belong to that group will not be able to see that field.

You can create a group in security/security.xml file of the module

<record id="Your_new_group" model="res.groups">
<field name="name">Your new group</field>
<field name="users" eval="IF YOU HAVE USERS CREATED IN DEMO DATA"/>                                    </record>

Note: you can also later assign users to this group from interface

Then go to the form view of project task and apply this group to the fields that you want to restrict. for eg:<field name="planned_hours" groups="project.Your_new_group"/>

Through Interface:

Referring 7.0 there is already a group available for this field. Just go to Settings/Users/Users

Edit the user that you want to apply restriction on. Go to second Tab (Access Rights) You will see under Technical Settings a boolean entry as 'Time Estimation on Tasks' just untick that for the user.

Note: If you are not able to view Technical Settings then you need to check the boolean Technical Features under the Access rights tab for the logged in user only then you will be able to view the details settings.


Hi Thanks for the fast answer. Can you give me more details or a link of how to create a group with the specific field and not object.

Jean-Philippe Bourque
on 3/21/13, 5:35 PM

Hi Jean, I have updated my original answer.

Naresh Soni (nch)
on 3/22/13, 2:26 PM

Thanks. Do you know a way through the interface and developer mode. To be honest, I'm not a professional programmer more a power user. I tried to avoid as much as possible to edit files.

Jean-Philippe Bourque
on 3/22/13, 3:23 PM

Hi Jean I have updated my original answer

Naresh Soni (nch)
on 3/25/13, 3:34 AM

Hi Naresh, That make a lot of sense :) Thank you. However,I just tried this and for a unknow reason the checkbox retick itself when I push the save button on the user?!?!!

Jean-Philippe Bourque
on 3/25/13, 10:58 AM

Hi Jean, yes it seems a problem but just try to relogin and do the same operation again that should work i.e second edition should be saved !

Naresh Soni (nch)
on 3/25/13, 1:29 PM

I tried what you said and other things as untick all checkbox related to tasks. They stay ticked !?! I will try other stuff later, I keep you posted

Jean-Philippe Bourque
on 3/25/13, 3:18 PM

Doesn't work and I tried a lot of possibilities...

Jean-Philippe Bourque
on 3/26/13, 10:43 AM

can you check here : http://7-0-5569.runbot.openerp.com/?db=7-0-5569-all I checked here and seems ok with second try i.e relogin again and doing the same operation on the user.

Naresh Soni (nch)
on 3/26/13, 12:58 PM

Hi, solved the issue in another way (see below). Comments for better implantation always welcome

Jean-Philippe Bourque
on 4/17/13, 4:19 PM

i'm also having the issue of the tick boxes staying checked. how did you solve this problem? thanks!

on 1/3/14, 9:05 PM
On 3/22/13, 10:22 AM

Creating group same not object level or field level, but how to use this field is depend you.

You can create group as usual in folder security --> security.xml file.

<record id="group_new" model="res.groups">
    <field name="name">new group</field>
    <field name="category_id" ref="base.module_category_hidden"/>

Hi, here the solution I put in place. Comments welcome if you saw some basics problems.

  • Activate debug mode
  • Go to the task view
  • In the debug dropdown select "Edit Formview"
  • Copy the the line containing the "planned hours" (see exemple below)
  • In one line add the groups attributes with the group allowed to edit (here project manager)
  • in other line add the Readonly group and the field attributes readonly="1" (here project user)

<field name="planned_hours" widget="float_time" groups="project.group_project_user" on_change="onchange_planned(planned_hours, effective_hours)" readonly="1"/>

<field name="planned_hours" widget="float_time" groups="project.group_project_manager" on_change="onchange_planned(planned_hours, effective_hours)"/>

Note1 : The technical feature "Task estimation" will be disabled for this specific field. The field will be visible by every users.

Note2 : For Manager the field will be displayed 2 times because of the inheritance from User, to avoid that you should remove the inherice

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/21/13, 12:43 PM
Seen: 2072 times
Last updated: 3/16/15, 8:10 AM