跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. Odoo 人力资源 雇员只能看自己关联的员工

Odoo 人力资源 雇员只能看自己关联的员工

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
5 帖子 3 发布者 4.9k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • Z 离线
    Z 离线
    zhong_163
    写于 最后由 编辑
    #1

    人力资源中,普通员工 只看自己关联的员工

    设置->技术->安全设定->记录规则 [attachimg=1]


    复杂的 规则  参照 http://cn.openerp.cn/record_rule/

    1 条回复 最后回复
    0
    • 卓忆卓 离线
      卓忆卓 离线
      卓忆
      写于 最后由 编辑
      #2

      谢谢分享!

      恬淡

      1 条回复 最后回复
      0
      • Z 离线
        Z 离线
        zhong_163
        写于 最后由 编辑
        #3

        本贴给 初学者 带来了两个坑
        1、 如此设置后,非admin 的 hr manager 账户,也只能看到自己, 解决方法 ,设置  一 个全局的 [(1,'=',1)] 对 group_hr_manager 账户

        2、 费用报销中,如果职员 设置了 部门经理,则 无法提交给经理
        技术上有个流程,就是 提交时 发消息给他的经理,让他审批;员工只看只看自己职员,那么无法访问他的经理,消息无法发成功

        这个需要在实施中做取舍

        顺便  贴一下达到上述目的 代码, 
        下面代码 可以 实现部门经理,培训讲师  看 下属员工,和自己看自己对应的员工

        <br />&nbsp; &nbsp; &lt;record id=&quot;property_rule_employee_manager&quot; model=&quot;ir.rule&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Manager Employee&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;model_id&quot; ref=&quot;hr.model_hr_employee&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;domain_force&quot;&gt;[(1,&#039;=&#039;,1)]&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;groups&quot; eval=&quot;[(4,ref(&#039;base.group_hr_manager&#039;)), (4,ref(&#039;base.group_hr_user&#039;))]&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;property_rule_employee_employee&quot; model=&quot;ir.rule&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Employee Owner&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;model_id&quot; ref=&quot;hr.model_hr_employee&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;domain_force&quot;&gt;&#91;&#039;|&#039;,&#039;|&#039;,(&#039;user_id&#039;,&#039;=&#039;,user.id),(&#039;parent_id.user_id&#039;,&#039;=&#039;,user.id),(&#039;coach_id.user_id&#039;,&#039;=&#039;,user.id)]&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;groups&quot; eval=&quot;[(4,ref(&#039;base.group_user&#039;))]&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br /><br /><br />
        
        1 条回复 最后回复
        0
        • wjfonhandW 离线
          wjfonhandW 离线
          wjfonhand
          写于 最后由 编辑
          #4

          慎用 1 = 1 ,多公司的场景下,这也是坑

          GoodERP -- Odoo China fork

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

          • 登录或注册以进行搜索。
          • 第一个帖子
            最后一个帖子
          0
          • 版块
          • 标签
          • 热门
          • 用户
          • 群组