This blog is exclusively composed of Odoo developers giving an insight into the technical transitions happened between Odoo 7 to Odoo 10. You all know that initial version was known to be Open ERP which finally picked the name Odoo. There are a lot of technical difference between Odoo version 7 and Odoo version 10 if we look in to. As a developer, I faced many hurdles and challenges during the onset of my work as no proper documents detailing the version changes especially the technical difference was made available at that point in time.
Let me start via giving a brief into on Odoo before going to the technicalities of the software. Odoo made its revolutionary entry in February 2005 with the name Tiny ERP. At the initial stage, Tiny ERP has 4 Releases-Version 1, 2, 3 and 4. Later in April 2009, Odoo released its 5’th version and got the name change with Open ERP from Tiny ERP. Open ERP further came up with 4 different versions- V5, V6, V6.1, and V7. Finally, soon after the release of version 7, Open ERP was finally titled to the beautiful phenomenal name Odoo, with all new branded theme and logo. The Odoo V8 got released on September 18, 2014. The latest Odoo series is embedded with 4 versions- V8, V9, V10, and V11. The version11 is coming soon with more functionalities and abreast technicalities.
Here in this blog, I troll you down through the technical transitions happened the versions Odoo 7 and Odoo 10
Main differences:
1) api (Application Programming Interface)
In version 7 we use a different api than we use in Versions 8, 9, 10.
Example for decorators of new api:
@api.returns, @api.multi, @api.one, @api.model, @api.constrains, @api.depends, @api.onchange, @api.noguess.
New api is used in v8, v9, and v10. V7 does not use new api.
In v7(Old Api) we have to pass parameters with the function like database cursor(cr), user id(uid), context dictionary(context), and record ids(ids).
v8 and v9 use both old api and new api.
In v8, v9 and v10(New api) Odoo introduce more object-oriented feel to the functions. We don’t need to put the parameters along with the function. Those parameters are hidden in the model.
v10 uses only new api.
2) pool
A pool is dictionary object that stores the instances of OpenERP model. OpenERP can manage multiple databases. Every database has a different pool. self.pool is referencing the current database instances. pool.get() method is removed in Odoo’s newest version. Version 7, 8 and 9 contain the pool object partially. Odoo 10 completely removes the pool object.
3) manifest file name
v7 | __openerep__.py |
v8 | __openerep__.py |
v9 | __openerep__.py |
v10 | __manifest__.py |
4) xml tags
v7 | <openerp> |
v8 | <openerp> |
v9 | <openerp> |
v10 | <odoo>
|
5) xpath
v7 <xpath expr="//field[@name='amount']" and [@string='amount']
v8 <xpath expr="//field[@name='amount']" and [@string='amount']
v9 <xpath expr="//field[@name='amount']"
v10 <xpath expr="//field[@name='amount']"
Referencing the xpath expression with the string is removed from v9.
6) env
v7 does not use the env notion. It is the notion of new api.
self.env['model.name'] is used in new api’s instead of self.pool.get('model.name').
v7 | _columns = { 'product_id': fields.many2one('product.product', 'Product'), } |
v8 | _columns = { 'product_id': fields.many2one('product.product', 'Product'), } and product_id = fields.Many2one('product.product', 'Product') |
v8 uses both old api and new api. That is why it can use both field declaration methods.
v9 | _columns = { 'product_id': fields.many2one('product.product', 'Product'), } and product_id = fields.Many2one('product.product', 'Product') |
v9 also uses both old api and new api. So it also use both field declaration methods.
v10 | product_id = fields.Many2one('product.product', 'Product') |
v10 uses only the new api.
8) set default values to fields.
v7 | _defaults = {
'date': lambda * a: datetime.datetime.now() } |
v8 | _defaults = {
'date': lambda * a: datetime.datetime.now() } and
date = fields.Date(string='Date', default=datetime.now()) |
v9 | _defaults = {
'date': lambda * a: datetime.datetime.now() } and
date = fields.Date(string='Date', default=datetime.now())
|
v10 | date = fields.Date(string='Date', default=datetime.now()) |
9) Java script changes.
v7 | function openerp_pos_models(instance, module) { var _t = instance.web._t;
}
|
v8 | function openerp_pos_models(instance, module) { var _t = instance.web._t;
} |
v9 | odoo.define('barcode_integration.interface', function(require) { ‘use strict’; var core = require(‘web.core’); var _t = core._t;
}); |
v10 | odoo.define('barcode_integration.interface', function(require) { ‘use strict’; var core = require(‘web.core’); var _t = core._t;
}); |
in the v7 and v8, we use raw js/ jquery. But in v9 and v10 we use Backbone js.
These are some basic changes made in the versions between 7 and 10. There are a lot of changes happened between version 7 and version 10. If you are interested in this blog, kindly inbox your valuable feedbacks which will motivate me to write in depth more on this topic.