odoo-technical-diffrences.png
Blogger_636313954228246944.jpg
By: Avinash

Changes made on technical side of Odoo in version 7 to version10

This blog is only for the developers of Odoo. You all know that Odoo version 7 was called OpenERP. Now it changes to Odoo. There are a lot of difference between version 7 to version 10. As a developer, I have faced the issue at the beginning of my development career, that there were no proper documents for changes created in the latest versions according to the previous versions. Odoo release in February 2005. At that time it's called Tiny ERP. Tiny ERP has 4 releases. Version 1, 2, 3 and 4. In April 2009 Odoo releases their 5’th version. At that time its changes the name to OpenERP. OpenERP has 4 versions. Version 5, 6, 6.1, and 7. After that OpenERP changes to Odoo. The version 8 is released on September 18, 2014. Odoo latest series have 4 versions. Version 8, 9, 10, and 11. version 11 is coming soon. So what I am trying to say is that the versions of Odoo 7 and Odoo 10 have so many differences in the technical side.

 

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

The 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    <xpath expr="//field[@string='amount']
             v8          <xpath expr="//field[@name='amount']"    and    <xpath expr="//field[@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 and v10.

 

6) env

 

v7 does not use the env notion. It's the notion of new api.

 

self.env['model.name'] is used in new api’s instead of self.pool.get('model.name').

 

7) Field declaration

 

          v7

           _columns = {

            'product_id': fields.many2one('product.product', 'Product'),

           }

v7 uses only the old api
         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 uses 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;

                        

                    <-----------Your Code----------->

                 

                    }

v8

                   

                    function openerp_pos_models(instance, module){

                            var _t = instance.web._t;

 

                   <-----------Your Code----------->

 

                    }

v9

 

                   odoo.define('barcode_integration.interface', function(require) {

                  ‘use strict’;

                   var core = require(‘web.core’);

                   var _t = core._t;

                   

                   <-----------Your Code----------->

 

                   });

v10

                  

                   odoo.define('barcode_integration.interface', function(require) {

                   ‘use strict’;

                   var core = require(‘web.core’);

                   var _t = core._t;

                   

                   <-----------Your Code----------->

 

                   });

 

 

In 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 from version 7 to version 10. If you are interested in this blog, then please give me the feedback. It will motivate me to write the continuation of this topic.

 

 

 




Comments

4

pawan

15/08/2017 - 2:07AM

nice post. Please provide more info about. Java script changes.


toni

06/10/2017 - 10:00AM

good article, thanks! I'm also interested in js changes


Shahid Ali

06/09/2017 - 6:53AM

Worthful


Jovani Moura

04/08/2017 - 9:14AM

Nice Explanation! Help me a lot.




Leave a comment