Odoo Help


pool is not defind error

on 5/3/13, 7:26 AM 1,261 views

import time import datetime from report import report_sxw #from tools import amount_to_text_en import pooler from tools import amount_to_text #from tools.amount_to_text import amount_to_text_infrom tools.translate import _

class lead_target(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(lead_target, self).__init__(cr, uid, name, context=context)
self.localcontext.update({ 'time': time,
'get_name':self.get_name, 'pool': self.pool,
}) self.context = context

def get_name(self, form):       
    for order in crm_obj.browse(cr, uid, id):
        print namev,"hhhhhhhhhhhhhhhhhhhhhhhhhhh"   
    print x 

            global name 'pool' is not defined

-------------------------------->if i do this i got this error (<type 'exceptions.nameerror'="">, NameError("global name 'pool' is not defined",), <traceback object="" at="" 0x7f070c2f0ea8="">)


Priyesh Solanki (pso)

--Priyesh Solanki (pso)--

| 2 2 4
--Priyesh Solanki (pso)--
Priyesh Solanki (pso)
On 5/3/13, 7:33 AM

You need to use crm_obj = self.pool.get('crm.lead') instead of that line.

not working

on 5/3/13, 7:42 AM

You can also try by removing 'pool': self.pool from self.localcontext and adding with crm_obj = self.pool.get('crm.lead') line. After doing this, just start openerp server and check if it is still giving you an error.

Priyesh Solanki (pso)
on 5/3/13, 7:59 AM

yes i tried but gave me a error

on 5/3/13, 8:03 AM

I guess there might be something wrong with your code. Priyesh Solanki's answer is correct. Did you restart your server after changing the code?

Sudhir Arya (ERP Harbor Consulting Services)
on 5/3/13, 8:51 AM

if i remove crm.lead browse code working fine if i add through error

on 5/3/13, 10:06 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


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

1 follower(s)


Asked: 5/3/13, 7:26 AM
Seen: 1261 times
Last updated: 3/16/15, 8:10 AM