Odoo Help


Error while try to access global variable .

Khatri Jeenit
on 7/29/16, 2:18 AM 254 views
#Global Variable
context_data = None # contains dictionary

def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
res = super(sales_dash_report, self).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
global context_copy

if view_type == 'form' and context_copy.get('key'):

#some code to execute

return res

While execute on local machine it executing normal but while try to run on production server then it gives an error that context_data (None object) has no attribute get.

Please help to solve this issue.

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 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/29/16, 2:18 AM
Seen: 254 times
Last updated: 7/29/16, 3:04 AM