Odoo Help

0
2
Axel Mendoza
On 9/3/15, 2:18 PM

In your case you can still use self.pool.get

To access self.pool.get I need to import pooler, and in the log it is reported as deprecated.

Raffaele
on 9/3/15, 4:17 PM

no need to import pooler, you just import pooler when you have no other way to access to your db models pool and you need to do it manually. This is not the case

Axel Mendoza
on 9/3/15, 4:55 PM

I write a more extensive explanation of report parsers at: https://www.odoo.com/es_ES/forum/help-1/question/how-to-define-a-custom-methods-functions-to-be-used-in-a-qweb-report-how-to-define-and-use-a-report-parser-92244

Axel Mendoza
on 10/15/15, 5:52 AM
1
Anil R. Kesariya (AKE)
On 9/3/15, 12:21 PM

Hi Raffaele,

You can only use self.env inside the class if your class inherits models.model not osv.Model or other objects.

for eg:

from openerp import models 
class class_name(models.Model):
#inside this class self.env can be use.

Updated (5,sept):

rml_parse is class which is defined inside /odoo/openerp/report/report_sxw.py file which is not inherits models.Model it simply inherits Object. So you cannot use self.env inside the parser class.

Hope this will help.

Rgds,

Anil.

Aeroo parser inherits report_sxw.rml_parse. https://github.com/gisce/aeroo/blob/master/report_aeroo_sample/report/parser.py

Raffaele
on 9/3/15, 4:03 PM

rml_parse is class which is defined inside /odoo/openerp/report/report_sxw.py file which is not inherits models.Model it simply inherits Object. So you cannot use self.env inside the parser class.

Anil R. Kesariya (AKE)
on 9/3/15, 10:05 PM

not enough karma to convert this as an answer.

Raffaele
on 9/4/15, 3:46 AM

Is that your ans? so i will update the in my same ans.

Anil R. Kesariya (AKE)
on 9/5/15, 6:14 AM

About This Community

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

Question tools

2 follower(s)

Stats

Asked: 9/3/15, 10:40 AM
Seen: 1665 times
Last updated: 11/29/15, 2:48 AM