OdooMindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
self.filtered(lambda sub: not sub.opt_out).opt_out_datetime = False
for subscription in self.filtered('opt_out'):
subscription.opt_out_datetime = self.env.cr.now()