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

Error while try to access global variable .

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

@api.model
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/29/16, 2:18 AM
Seen: 175 times
Last updated: 7/29/16, 3:04 AM