def METHOD_NAME(self):
    valid_account_ids = self.get_valid_accounts()
    if not valid_account_ids:
        self.update({"hide_link_asset_button": True})
    else:
        for move in self:
            move.hide_link_asset_button = (
                not any(
                    [
                        line.account_id.id in valid_account_ids.ids
                        for line in move.invoice_line_ids
                    ]
                )
                or move.state != "posted"
            )