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


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


Open ERP API change for V6.1

  • 管理员

    OpenERP API 在开发分支中(未来V6.1版本)有以下变化:<br /><br />1) fields.function() does not take a "method" parameter anymore [1]. It<br />was useless and every field was passing method=True. It is possible to<br />pass a normal function too, it simply needs to have the proper signature<br />(see the docstring). Don't forget to run 'bzr pull' on the server,<br />otherwise the trunk addons will not work anymore.<br />And please do not use the "method" parameter anymore in trunk! (it's<br />ignored, though, so it's backwards compatible)<br />function字段定义不需要“method”参数了<br /><br />2) There is no need to call the constructor of each osv object anymore<br />after defining it. This is now done automagically by the osv<br />metaclass[2], so you can save this line for every osv object you<br />declare. Calling the constructor will not hurt, but it's unnecessary.<br />在定义好osv对象,不需要再去调用执行了,(这个好啊,我自己经常会忘记调用)比如:<br />class myobj(osv.osv):<br />    .....<br />myobj() <----不需要了<br /><br />3) You don't need to split osv classes when there are circular<br />references, such as users <-> groups. Modules are now loaded in several<br />passes to resolve the dependencies [2].<br />看看res.users模块,users和groups分别有many2many的字段指向对方,以前我们只能创建groups,在users定义之后再创建groups2(继承groups,并定义与users关联的many2many字段)<br />现在不需要那么麻烦了。直接分别定义就好了

  • 第三点改进很棒啊...<br /><br />但这样底层的大动作... 对于partner 来讲,,, 太过痛苦了...

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

  • 管理员

    [quote author=mrshelly link=topic=2531.msg8357#msg8357 date=1310708644]<br />但这样底层的大动作... 对于partner 来讲,,, 太过痛苦了...<br />[/quote]<br /><br />这些改变基本上保持了向后兼容,应该问题不大<br /><br />[quote author=wjfonhand link=topic=2531.msg8358#msg8358 date=1310737877]<br />不知道什么时候能像tryton那样不必每次调用和定义method的时候都写cr,uid这类的参数。<br />[/quote] <br />这些不是不能改,只是改了以后保持向后兼容的难度比较大