Odoo 中文社区

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

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

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

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

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

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

    Open ERP API change for V6.1

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

      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
      • mrshelly
        mrshelly 最后由 编辑

        第三点改进很棒啊...

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

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

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

          GoodERP -- Odoo China fork

          1 条回复 最后回复 回复 引用 0
          • digitalsatori
            digitalsatori 管理员 最后由 编辑

            [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
            • First post
              Last post