Hello,
I have this field :
switch_power = fields.Selection([('1','On'),('0','Off')],'Power')
And i have defined a button which change the value of "switch_power" according to this function :
@api.multi
def message_test(self):
if(self.switch_power=='1'):
self.switch_power='0'
raise osv.except_osv(('Button test!'), ('Le button est on'))
else:
self.switch_power='1'
raise osv.except_osv(('Button test!'), ('Le button est off'))
The problem is when i click in the button, The message is displayed, but the value of "switch_power" dosen't changed.
Any help please ?
https://stackoverflow.com/questions/10280874/is-it-possible-for-a-statement-to-be-executed-after-raise-in-python