Odoo Help

7
19
Avatar

Anil R. Kesariya (AKE)

--Anil R. Kesariya (AKE)--
6169
| 7 6 8
Rajkot, India
--Anil R. Kesariya (AKE)--

Odoo Techno Functional Expert

* Engaged with odoo since May - 2012.

* Customise existing module or develop new module base on customer requirement.

* Played key developer role in many past and running projects.

* Expert in requirement gathering of business and transforming requirement into odoo platform.

* Major expertise in core modules, database, report development and theme development.

* Integration expert.


Linkedin  : https://in.linkedin.com/in/anil-kesariya-97b20a66


Anil R. Kesariya (AKE)
On 12/23/17, 4:53 AM

Hello All,

Here is some info about new changes on v11.

Python3 Syntactical changes for odoo v11.

1. All the py file which resides in same folder or directory will be imported like, this is mandatory in v11 now.

v11.

from . import <your_file_name>

v10

import <your_file_name>

2. Dictionary syntax on iteration.

v11  (Python3)

dict = {'a':"Anil","k":"Kesariya"}
for k, v in dict.items():
print "KEY ::",k
print "VALUE ::",v
    #your code.

v10  (Python2)

dict = {'a':"Anil","k":"Kesariya"}
for k, v in dict.iteritems():
print "KEY ::",k
print "VALUE ::",v
    #your code.

3. Print Statement

v11 (Python3)

print("Your Message")

v10,

You must know already :)

print "Your message"

4. has_key() will not work anymore.

 - Use .get() function instead has_key() in the dictionary


Module Enhancements:


1. Module renamed.

- an account_accountant module is renamed with account_invoicing.

- sale module is renamed with sale_management.

2. Merged module 

Following module, you will not find inside odoo v11 addons,

- account_tax_cash_basis

report
Because they are merged with following modules.

- account_tax_cash_basis this module is merged with account module.

- report module is merged with web module.


3. Changed model name.

-  It will be updated soon.


4. Completely removed

- Workflow has been completely removed from v11, till v10 it was deprecated and supported.


5. Changes or updates to fields in respective of specific model (table)

- ir.cron :argument could be directly passed to function, instead of function there is code field which allows to add python code or call of function associated model, instead of model now it is model_id to reference, like we do for security record rule. from the below example you will understand more about the difference between v10 and v11.

   v11

<!--Scheduler Sync Send Request-->
<record id="gengo_sync_send_request_scheduler" model="ir.cron">
<field name="name">Gengo: Sync translation (Request)</field>
<field name="model_id" ref="base_gengo.model_base_gengo_translations"/>
<field name="state">code</field>
<field name="code">model._sync_request(20)</field>
<field name="interval_number">6</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>

v10

<record id="gengo_sync_send_request_scheduler" model="ir.cron">
<field name="name" >Gengo Sync Translation (Request)</field>
<field eval="True" name="active"/>
<field name="interval_number">6</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model" eval="'base.gengo.translations'"></field>
<field name="function" eval="'_sync_request'"/>
<field name="args" eval="'(20,)'"/>
</record>


6. Report Improvements,  

def render_html() method replaced with get_report_values() with same api decorator and argument list.

E.g. v11.

 @api.model
 def get_report_values(self, docids, data=None):

E.g. v10.

def render_html(self, docids, data=None):


Note: the return statement (result) is different in both methods.


- Below is example which will explain better the return of result.


E.g. v10

@api.model
def render_html(self, docids, data=None):
docargs = {}
return self.env['report'].render('account.report_journal', docargs)


E.g. v11


@api.model
def get_report_values(self, docids, data=None):
docargs = {}
return docargs

get_action() method is replaced with report_action() for call report template.

The following example will explain better.

E.g. v11.

return self.env.ref(report_template_action_external_id).report_action(self, data=data)

E.g. v10

 return self.env['report'].get_action(self, report_tempalte_external_id, data=data) 


• To call the _run_wkhtmltopdf() from the different model and also change the argument sequence.

 

E.g. v11

self.env['ir.actions.report']._run_wkhtmltopdf(arguments)

E.g. v10

 self.env['report']._run_wkhtmltopdf(arguments)


- get_html() is replaced with render_qweb_html()

Hope this answer will you help in migration process of v11, any idea or correction appreciated.


Reference for JS framework update

1. Click here

2. Click here

3. Sample code reference, Click here

Best Regards,

Anil Kesariya.

Sale module Is also renamed ..sale_management

Niyas Raphy
on 12/23/17, 6:04 AM

thanks, updated.

Anil R. Kesariya (AKE)
on 12/23/17, 6:13 AM

Thanks, very helpful!

Ermin Trevisan
on 12/23/17, 8:34 AM

Thank you @Ermin, for appreciation and upvote :)

Anil R. Kesariya (AKE)
on 12/23/17, 8:44 AM

get_html is changed to render_qweb_html

Niyas Raphy
on 12/26/17, 3:38 AM

Changes in js see this video : https://www.youtube.com/watch?v=u-6aLi1oqcw

You can update the answer with this :)

Niyas Raphy
on 12/29/17, 1:23 AM
6
Avatar

Niyas Raphy

--Niyas Raphy--
12361
| 6 6 9
Calicut, India
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to contact :  niyasraphyk@gmail.com

Niyas Raphy
On 12/23/17, 6:03 AM

thanks.

Anil R. Kesariya (AKE)
on 12/23/17, 6:12 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 12/23/17, 3:58 AM
Seen: 3401 times
Last updated: 8/27/18, 12:14 AM