Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

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

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

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

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

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

    [分享]OpenERP view xml 节点属性继承更改.

    Odoo 开发与实施交流
    3
    5
    6935
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • mrshelly
      mrshelly 最后由 编辑

      很赞....  OpenERP 6.0 在视图继承 的时候 可以使用 xpath 定位, 并且支持了 inside, before, after, replace 等方法.. 但有时候 对于视图的一些节点的属性小修改. 在  5.0.x 的时候 似乎还没有支持(我还没在 5.0.x 看到相关的使用),  昨天得  东莞-lky(176372509)  指点...  使用 position="attributes" 进行节点的 属性修改. 并成功...

      参见 6.0.2 addons\hr\hr_view.xml 文件 (hr 模块)
      背景, 修改 Notes 这个页签, 只允许 base.group_hr_manager组可见.

      原 Notes 页签相关 xml:

       <br /><br />...<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;page string=&quot;Notes&quot; groups=&quot;base.group_hr_user&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field colspan=&quot;4&quot; nolabel=&quot;1&quot; name=&quot;notes&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/page&gt;<br /><br />...<br />
      



      可以使用 继承视图来进行修改:

      <br />...<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xpath expr=&#039;//page[@string=&quot;Notes&quot;]&#039; position=&#039;attributes&#039;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;attribute name=&#039;groups&#039;&gt;base.group_hr_manager&lt;/attribute&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/xpath&gt;<br /><br />...<br />
      




      再一次体会到OpenERP 的强大, 并希望她越来越漂亮.....

      1 条回复 最后回复 回复 引用 0
      • L
        lky 最后由 编辑

        shelly老师真客气,其实我不懂position="attributes" .

        1 条回复 最后回复 回复 引用 0
        • mrshelly
          mrshelly 最后由 编辑

          [quote author=lky link=topic=2568.msg8518#msg8518 date=1314320852]
          shelly老师真客气,其实我不懂position="attributes" .
          [/quote]

          咱们来互相赞美一番. 如何???

          😃

          不知道为什么这个特性在 http://doc.openerp.com/v6.0/developer/2_6_views_events/views/view_inheritence.html 不开放出来(@2011-08-26 09:12:00)... 很奇怪.. 理论上, 6.0.2 都 release 了. 这个东西应该要放出来到 文档中了.

          1 条回复 最后回复 回复 引用 0
          • wjfonhand
            wjfonhand 最后由 编辑

            貌似在一篇blog中看到过。是6.0新增加的功能

            GoodERP -- Odoo China fork

            1 条回复 最后回复 回复 引用 0
            • First post
              Last post