Ok, i tried that but still getting exceptions, to prevent the (TypeError: read() got an unexpected keyword argument 'load') i comented my overloaded read method, then with field_x = data['field_x'] i got ,KeyError: 'field_x'
I don't know what i am doing wrong here is my code:
Code:
from osv import osv, fields
class wiz_unsu(osv.osv_memory):
_name = 'club.wizard.unsu'
_columns = {
'reasons': fields.char('Reasons to unsuscribe', size=140, required=True),
'actions': fields.char('Actions', size=210, required=True),
}
def unsuscribe(self, cr, uid, data, context=None):
pooldata = self.pool.get('club.activees')
active_ids = context.get('active_ids', [])
values ={'type':'ir.actions.act_window_close'}
pooldata.send_unsu(cr, uid, active_ids, context=context)
return values
wiz_unsu()
send_usu function, part of club.activees object which calls the wizard :
Code:
data = self.read(cr, uid, ids, context=context)[0]
field_x = data['reasons']
So ther i got ->
KeyError: reasonsAnd this is my read overloaded method which causes the first exception
TypeError: read() got an unexpected keyword argument 'load'Code:
def read(self, cr, uid, ids, fields=None, context=None):
values = super(club_activees, self).read(cr, uid, ids, fields, context)
finality=values[0].get('finality', False)
try:
fin_list = finality.split(';')
values[0]['n_fin'] = len(fin_list)
for f in fin_list : values[0]['f'+f] = True
except: values[0]['n_fin'] = 0
return values