Instead of the button, you can go with Boolean field.
Please add boolean field in the product template.
Now add the below domain on the product field of your product line on the template of quotation, sales order and bills fields.
domain = "[('your_boolean_field', '=', False)]"
This will filtered your flagged products when you select it in the product lines product field.
Hope it will help you.