in v8 which is the best way to reference to another model from within a parser?
Eg. I need to reference ir.config_parameter, but using self.env['ir.config_parameter'] I get error from Aeroo "env is not defined"
You can only use self.env inside the class if your class inherits models.model not osv.Model or other objects.
from openerp import models
#inside this class self.env can be use.
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.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 9/3/15, 10:40 AM|
|Seen: 657 times|
|Last updated: 11/29/15, 2:48 AM|