Odoo Help

0

Error while try to access global variable .

By
Khatri Jeenit
on 7/29/16, 2:18 AM 490 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.

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.

Register

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)

Stats

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