1
votes

I want hide fields for user in odoo 9. For example, hide Deadline in Project > Task module. Only administrator can see this fields.

Any solution how create group etc. hide_only_admin_see and in field add this line.

<field name="date_deadline" groups="hide_only_admin_see"  />

I'm find in source groups="base.group_no_one", groups="base.group_user"

but don't understand is it possible create my own group, when add to fiels that only Manager can see this...

2

2 Answers

1
votes

Here is my solution:

  1. https://postimg.org/image/rvxi74f51/

  2. https://postimg.org/image/b87h1dlhv/

  3. https://postimg.org/image/5mzst1wtz/

  4. ID from file add to field etc: groups="export.res_groups_84"

0
votes

On odoo 8, you forbid access to a field to all users (except configuration permissions) in that way:

<field name="date_deadline" position="attributes">
       <attribute name="groups">base.group_system</attribute>
</field>

To create new group of permissions, on odoo 8, you can create record for new category like:

<record model="ir.module.category" id="xxx">
            <field name="name">Name of new category of permissions</field>
            <field name="sequence">200</field>
        </record>

You can create new records for groups permission on res_groups:

<record model="res.groups" id="hide_only_admin_see">
      <field name="category_id" ref="XXXX"/>
      <field name="name">Usuario</field>
</record>

On category_id you must write the ir_module_category you are creating / overridiing. After this, you have to create a line on your ir.model.access.csv to give correct permissions to the model you want, something like:

"access_project.issue","project_issue access","model_project_issue","hide_only_admin_see",1,0,0,0

Finally, go to the line and override like:

<field name="date_deadline" groups="your_custom_module.hide_only_admin_see"  />