Odoo Help


NameError: global name "xyz" not defined

Aijay Ogbugha
on 7/4/13, 11:30 AM 1,525 views

Am trying to define a method that calculates the amount for each line of purchase like this :

def _myMethod():
    res = {}
    for x in self.browse(cr, uid, ids):
        res[bo] = x.value * xyz 
    return res

And it is giving me a NameError. Please does anyone know why am getting this error and how to fix it.

Thank you

Tech Receptives
On 7/4/13, 11:33 AM
def _myMethod():
    res = {}
    for x in self.browse(cr, uid, ids):
        res[x.id] = x.value * xyz 
    return res

apart from this what are the arguments of def _myMethod():



Thanks Parthiv, this was helpful

Aijay Ogbugha
on 7/4/13, 12:26 PM

You are welcome :)

Tech Receptives
on 7/4/13, 3:47 PM

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: 7/4/13, 11:30 AM
Seen: 1525 times
Last updated: 3/16/15, 8:10 AM