In Odoo-9 reports are written in HTML/QWeb, like all regular views in Odoo. You can use the usual QWeb control flow tools. The PDF rendering itself is performed by pdf.For example code is below.
attachment="(object.state in ('open','paid')) and
('INV'+(object.number or '').replace('/','')+'.pdf')"
Note- The paper format cannot currently be declared via the shortcut, it must be added afterwards using a extension on the report action itself.