Sync to Invoices form,list code if records: # Filter to only ADP sales adp_records = records.filtered(lambda r: r.x_fc_is_adp_sale and r.state == 'sale') if adp_records: action = adp_records.action_sync_adp_fields() else: action = { 'type': 'ir.actions.client', 'tag': 'display_notification', 'params': { 'title': 'No ADP Sales', 'message': 'Selected orders are not confirmed ADP sales.', 'type': 'warning', 'sticky': False, } }