跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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. [分享]OpenERP view xml 节点属性继承更改.

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

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

    很赞....  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 离线
      L 离线
      lky
      写于 最后由 编辑
      #2

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

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

        [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
        • wjfonhandW 离线
          wjfonhandW 离线
          wjfonhand
          写于 最后由 编辑
          #4

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

          GoodERP -- Odoo China fork

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

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