Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    关于在新建模块中新建的group访问其他模块中的model的问题

    Odoo 开发与实施交流
    2
    4
    4038
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xichun last edited by

      例如:在新建模块md_user中新建组:sub_company_sys,sub_company_sys 要访问base模块的res_users,如果不在md_user模块中继承res_users,安装时会报No such external ID currently defined in the system: mod_user.model_res_users的错误,所在只要在md_user模块中继承res_users就可以了,不知各位大虾还有没有其他更简单的方法?

      security.xml部分代码:

      <br />&nbsp; &nbsp; &lt;!--定义子公司系统访问组--&gt;<br />&nbsp; &nbsp; &lt;record model=&quot;res.groups&quot; context=&quot;{&#039;noadmin&#039;:True}&quot; id=&quot;sub_company_sys_access&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Sub Company Access Rights&lt;/field&gt;<br />&nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &lt;!--定义子公司系统设置组--&gt;<br />&nbsp; &nbsp; &lt;record model=&quot;res.groups&quot; context=&quot;{&#039;noadmin&#039;:True}&quot; id=&quot;sub_company_sys&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Sub Company Configuration&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &lt;field name=&quot;implied_ids&quot; eval=&quot;[(4, ref(&#039;sub_company_sys_access&#039;))]&quot;/&gt;<br />&nbsp; &nbsp; &lt;/record&gt;<br />
      



      ir.model.access.csv文件部分代码:

      <br />&quot;access_res_users_sub_company_sys&quot;,&quot;res_users sub_company_sys&quot;,&quot;model_res_users&quot;,&quot;sub_company_sys&quot;,1,1,1,1<br /><br />
      



      md_user.py部分代码:

      <br />class modify_user(osv.osv):<br />&nbsp; &nbsp; _inherit = &quot;res.users&quot;<br />modify_user()<br />
      



      1 Reply Last reply Reply Quote 0
      • X
        xichun last edited by

        @Jeff供最简单方法:
        "access_res_users_sub_company_sys","res_users sub_company_sys","base.model_res_users","sub_company_sys",1,1,1,1
        在此谢过

        1 Reply Last reply Reply Quote 0
        • Joshua
          Joshua 管理员 last edited by

          @xichun jeff的不是最简单的方法..是正确的方法。

          【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

          1 Reply Last reply Reply Quote 0
          • First post
            Last post