Contact Us  +1 (650) 307-6736 +32 81813700

Improvements on the framework

ShareThis !

We are going to develop significant improvements in the framework for the version 7.0. These improvements will allow OpenERP to be even more modular, to be easier to learn for new developers, to develop module with less lines of code and to be more pythonic.

Our first tests allowed us to reduce a simple module (the "idea" one) from 300 lines of code to 200 lines (33% less). We also significantly reduced the number of methods' signatures to learn by making all concepts more orthogonal and generic. This will lower the learning curve for new developers.

Among all the improvements, the most important ones are:

 
  • a more "object oriented" ORM that also supports write/create on objects, with simplified method signatures "def method(self)" instead of "def method(self, cr, uid, ids, context)".
  • a completely new way to manage "on_change" events to simplify inheritance in different modules
  • a merge of 3 different concepts (`_defaults`, `on_change`, `fields.function`) into one single concept (`get` attribute) in order to reduce the code to develop, and allow more flexibility (a function field may also be updated by on_change event, in real time, without additional code)
  • a pythonic way to express domains. For instance "invoice.partner_id.customer == False or invoice.total > 100", instead of "['|', ('partner_id.customer','=',False), ('total','>',100)]"
  • every concept can be implemented in the view definition or in the object:
  • a constraint (required, default, ...) in the view impact the encoding, a constraint in the object becomes an integrity constraint for the record
  • on_change is just implemented by a "get" in the view, a fields.function is just implemented by a "get" on the object

Of course, we will ensure that all those improvements will be backward compatible so that v7.0 will still support all community modules.

All these improvements will be presented and discussed/challenged during the community meeting of the next week. If you want to read the presentation before or you can not join us next week, you can already find it at http://thu.openerp.com/open-days-2012/core-api-draft.html.

Date : 9th April, 2012