Odoo Help

Welcome!

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.

0

NameError: global name "xyz" not defined

By
Aijay Ogbugha
on 7/4/13, 11:30 AM 1,118 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

1
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():

Cheers,

Parthiv

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

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)

Stats

Asked: 7/4/13, 11:30 AM
Seen: 1118 times
Last updated: 3/16/15, 8:10 AM