Hello,
I have defined 2 fields :
switch_power = fields.Selection([('1','On'),('0','Off')],'Power')
switch_power_bool = fields.Char(string='Switch_power_bool', required=False)
And i have defined a function which modify the "switch_power_pool" according the "switch_power"
@api.onchange('switch_power')
@api.multi
def change_switch_bool(self):
pack = self.env['affichage2.pack_stock'].search([('id', '=', self.pack_id.id)])
tab=[0]*(pack.switch_number)
xx = ''.join([str(x) for x in tab])
tab[self.pin_switch]=self.switch_power
b = ''.join([str(x) for x in tab])
self.switch_power_bool=b
My problem is that the "swith_power_bool " didn't changed.
Any help please ? Thank you