跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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. Open ERP API change for V6.1

Open ERP API change for V6.1

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

    OpenERP API 在开发分支中(未来V6.1版本)有以下变化:

    1) fields.function() does not take a "method" parameter anymore [1]. It
    was useless and every field was passing method=True. It is possible to
    pass a normal function too, it simply needs to have the proper signature
    (see the docstring). Don't forget to run 'bzr pull' on the server,
    otherwise the trunk addons will not work anymore.
    And please do not use the "method" parameter anymore in trunk! (it's
    ignored, though, so it's backwards compatible)
    function字段定义不需要“method”参数了

    2) There is no need to call the constructor of each osv object anymore
    after defining it. This is now done automagically by the osv
    metaclass[2], so you can save this line for every osv object you
    declare. Calling the constructor will not hurt, but it's unnecessary.
    在定义好osv对象,不需要再去调用执行了,(这个好啊,我自己经常会忘记调用)比如:
    class myobj(osv.osv):
        .....
    myobj() <----不需要了

    3) You don't need to split osv classes when there are circular
    references, such as users <-> groups. Modules are now loaded in several
    passes to resolve the dependencies [2].
    看看res.users模块,users和groups分别有many2many的字段指向对方,以前我们只能创建groups,在users定义之后再创建groups2(继承groups,并定义与users关联的many2many字段)
    现在不需要那么麻烦了。直接分别定义就好了

    【上海先安科技】(tony AT openerp.cn)

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

      第三点改进很棒啊...

      但这样底层的大动作... 对于partner 来讲,,, 太过痛苦了...

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

        不知道什么时候能像tryton那样不必每次调用和定义method的时候都写cr,uid这类的参数。

        GoodERP -- Odoo China fork

        1 条回复 最后回复
        0
        • digitalsatoriD 离线
          digitalsatoriD 离线
          digitalsatori 管理员
          写于 最后由 编辑
          #4

          [quote author=mrshelly link=topic=2531.msg8357#msg8357 date=1310708644]
          但这样底层的大动作... 对于partner 来讲,,, 太过痛苦了...
          [/quote]

          这些改变基本上保持了向后兼容,应该问题不大

          [quote author=wjfonhand link=topic=2531.msg8358#msg8358 date=1310737877]
          不知道什么时候能像tryton那样不必每次调用和定义method的时候都写cr,uid这类的参数。
          [/quote]
          这些不是不能改,只是改了以后保持向后兼容的难度比较大

          【上海先安科技】(tony AT openerp.cn)

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

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