Hi Med Said, thank you for your response. The following is the Python Code we put into the Server Action:
def parse_description(description):
fields=['name','company','address','phone','mobile','email','message']
_dict={}
description=description.lower()
for line in description.split('\n'):
for field in fields:
if field in line:
split_line=line.split(':')
if len(split_line)>1:
_dict[field]=line.split(':')[1]
return _dict
lead=self.browse(cr,uid,context['active_id'],context=context)
description=lead['description']
_dict=parse_description(description)
self.write(cr,uid,context['active_id'],{
'name':_dict.get('name'),
'partner_name':_dict.get('company'),
'phone':_dict.get('phone'),
'mobile':_dict.get('mobile'),
'contact_name':_dict.get('name'),
'email_from':_dict.get('email'),
'street':_dict.get('address'),
'description':_dict.get('message')}, context=context)
We are not sure which part is causing the STORE_FAST opcode. We have tested to compile the same string under normal python and the dis of the compile code does not list STORE_FAST either.
EDIT:
After further testing, we found out that if the code in Python code contains a named method, it raises the said error. Further reading into the openerp/tools/safe_eval.py file in OpenERP server lines 143 and 144 seems to support the suspicion. Any way, refactoring the method from the Python Code (making it into normal calls without methods) seems to resolve the issue.
Also it seems that STORE_FAST, along with LOAD_FAST and DELETE_FAST has been listed as allowable opcode since revno 5290 in launchpad or revision 4836354 in github (28 Apr 2014).