I have added a Boolean attribute to res_config_settings. When the Boolean is False I want to delete all records in a custom Model ('my.device').
I have tried three different approaches:
1.In res_config_settings
:
devices = self.env['my.device'].browse()
devices.unlink()
- also in
res_config_settings
:
devices = self.env['my.device'].browse()
for d in devices:
d.unlink()
- in
my.device
model
def unlink_all(self):
for rec in self:
rec.unlink()
Then call self.env['pushbullet.device'].unlink_all()
from res_config_settings
.
None of the options work but strangely, the first time I tried Option 1, all but one record was deleted.