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

Record Rule for Project Tasks

By
dirtyHandsPHP
on 7/25/14, 5:25 AM 958 views

Hi, Working with record rules for Project/Tasks

Requirement :

1. Each employee should be able to see only those tasks which are assigned to him.

Achieved through record rule using [('user_id','=',user.id)] domain filter with Task Object. Group Name : Project/User

2. Employee should be able to add only work summary means timesheet. But right now, even after applying above record rule he can assign task to other person, can change task name, Deasdline etc....

Can anyone please help me to writer proper Record Rule.

Thanks in advance!!

1

Hello Shiv,

If you add a rule as per your 1st step then users will be able to Edit the records. So of course they can make change in deadline, description, assign to other users etc...

 If you give edit rights then & then users will able to add summery / timesheet entries into task. and If they are able able to add/modify/delete entries in summery then other fields of task must be editable. the feature you want, might be impossible to acthieve from record rules.

So you need to think from some custom way, For example,

  1. You can add a group and add those fields under that group. So only some persons can edit those fields of task ( Deadlines, decription, user,name etc..) Then you can give editable rights to task. Now evenif, as per your 1st point, user is able to edit the task, those fields ( Deadlines, decription, user,name etc..) will not be editable. So user can add only task summery.
  2.  You can create Custom form view, and show that form view to those users which are not supposed to edit other fields except the task summery. Hide main task FORM view from those users. Add that new menu under that group, so only some of users (high level users) can edit all the fields of task.

Let me know if you have further questions,

Regards,

@Hiren : Thank you so much for your detailed answer. But in my case i have given only Read permissions to record rule then how user can edit it??

dirtyHandsPHP
on 7/25/14, 7:25 AM

Hello Shiv, If read permission is there then user will not able to edit the task entries. Becayse task work is itself attached to Task object as one2many relationship.

Hiren Vora - CEO at Emipro Technologies Pvt. Ltd. India
on 7/25/14, 8:45 AM

Hi Hiren...sorry for wrong expression ?? sign. I mean to say i have given only read permissions but still user is able to edit it. why?

dirtyHandsPHP
on 7/25/14, 8:56 AM

@Hiren: One more question. From your answer i reached on this conclusion : We can use Record rules to restrict users at some high level means till objects. To restrict users on form level or low level we have to make change using Groups - Access Rights. Right?

dirtyHandsPHP
on 7/25/14, 8:58 AM

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: 7/25/14, 5:25 AM
Seen: 958 times
Last updated: 3/16/15, 8:10 AM