Attrs
As far as I know, in attrs you can only pass OpenERP basic "domain".
The domain is parsed by the Web client. That force you to have all fields used in domain in the view event if not shown, they must be invisible fields.
The domain value must be static.
attrs="{'readonly': [('my_filed_must_be_in_view', '=', 'static_value')]}"
You can not use complex function, or server related code the scope is limited to the view.
Domain
Normaly when you add a domain on a field using view definition you can use any kind of standard domain condition.
[('invoice.partner_id.name', '=', True)]
But you have to consider your self outside of system. It means you can only do domain that will work trough an XMLRPC call.
In the domain value you can use any static value or any field value. Once again if you want to use a field that is not shown as a value, it must be present in view even if invisible.
I do not think you can use context in domain value like in ir.action domain but I will not be categoric.
Regards