2016-10-03 86 views
1

我想在odoo 9中隐藏用户字段。例如,在项目>任务模块中隐藏截止日期。 只有管理员才能看到这些字段。在odoo9中隐藏字段openerp

任何解决方案如何创建组等hide_only_admin_see和在字段中添加此行。

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

我找到源groups="base.group_no_one", groups="base.group_user"

,但不明白的是,可以创建自己的组中,当添加到fiels只有经理可以看到这个...

回答

0

在odoo 8,你禁止以这种方式获得了现场所有用户(除配置权限):

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

要创建权限的新组, 上odoo 8,你可以像新的类别创造纪录:

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

您可以在res_groups创建组权限的新记录:

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

在CATEGORY_ID你必须写你所创建的ir_module_category/overridiing。 在此之后,你必须创建你的ir.model.access.csv一行给出正确的权限你想,像模型:

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

最后,进入线路和覆盖诸如:

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