Odoo Help


This community 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.


pool is not defind error

on 5/3/13, 7:26 AM 847 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)--
Tiny ERP Pvt Ltd
| 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 (SA)
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

Your Answer

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

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

Question tools

1 follower(s)


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